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

Limit number of image or video #307

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

huylv-teko
Copy link

@huylv-teko huylv-teko commented Oct 8, 2020

If you want to limit number of image or video when select, set this:

imagePicker.settings.fetch.assets.supportedMediaTypes = [.image(max: 2), .video(max: 1)]

And when you select the third image, it should invoke this function:

func imagePicker(_ imagePicker: ImagePickerController, didReachSelectionLimitForType type: PHAssetMediaType)

@mikaoj
Copy link
Owner

mikaoj commented Oct 20, 2020

I don't mind adding a per asset type selection limit. But this to me looks like it can be confusing to use as there now is multiple ways to set a selection limit.

Do you think there is any way you can re-think how it is implemented?

Example/ViewController.swift Outdated Show resolved Hide resolved
Sources/Controller/ImagePickerController+Closure.swift Outdated Show resolved Hide resolved
@huylv-teko huylv-teko force-pushed the feature/limit-by-type branch 2 times, most recently from 7aaa5c9 to 741941c Compare October 21, 2020 09:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants