Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use constant for configuring limit #19

Merged
merged 3 commits into from
Jan 4, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions Example/Pickle/CarousellImagePickerController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import UIKit
import Pickle
import Photos

private let selectionsLimit: Int = 4

internal class CarousellImagePickerController: ImagePickerController {

internal init() {
Expand Down Expand Up @@ -47,7 +49,7 @@ internal class CarousellImagePickerController: ImagePickerController {
)

let subtitle = NSAttributedString(
string: "You can choose up to 4 photos for your listing.\n",
string: "You can choose up to \(selectionsLimit) photos for your listing.\n",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like a good idea! Does it need a .stringsdict in the example for both singular and plural photos?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How to pass selectionsLimit and hint text from viewController?

attributes: [
NSFontAttributeName: UIFont.systemFont(ofSize: 12),
NSForegroundColorAttributeName: UIColor.darkGray,
Expand Down Expand Up @@ -98,7 +100,7 @@ private struct CarousellTheme: ImagePickerConfigurable {

var imageTagTextAttributes: [String: Any]? = nil
var selectedImageOverlayColor: UIColor? = nil
let allowedSelections: ImagePickerSelection? = .limit(to: 4)
let allowedSelections: ImagePickerSelection? = .limit(to: selectionsLimit)

// MARK: -

Expand Down