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

Allow no selection when multi-selecting #249

Merged
merged 2 commits into from
Dec 10, 2018

Conversation

mpiechocki
Copy link
Contributor

Attempt to fix #247, as I can't see the point of not allowing this.

I also tried to maintain selection variable so it always contains what is actually selected (as I think this is more readable and understandable and reliable). Hopefully I didn't break anything else! ;)

@mpiechocki
Copy link
Contributor Author

And also, I have no idea how to make codebeat check pass :D

@NikKovIos
Copy link
Collaborator

Hi @mpiechocki! Thank you for your PR. I checked the code briefly and want to ask you to test the app more carefully. Because you can fix one feature, but produce bugs.
Please test when in the library would be big photos, videos. Test with multiple selection staring from different items (not only first or only photos).

Waiting for your answer :)

@mpiechocki
Copy link
Contributor Author

Hey, @NikKovIos! After playing around with a simple app (videos, images and all the edge cases I could come up with) I couldn't break it, so I assume it's working pretty well ;) Of course, further tests (and any automated tests :p) would be appreciated, but for now, I don't know if I can provide any more evidence :p

@mpiechocki
Copy link
Contributor Author

mpiechocki commented Oct 16, 2018

And I think now we can get rid of a lot of code from

public func selectedMedia(photoCallback: @escaping (_ photo: YPMediaPhoto) -> Void,
                              videoCallback: @escaping (_ videoURL: YPMediaVideo) -> Void,
                              multipleItemsCallback: @escaping (_ items: [YPMediaItem]) -> Void)

So that whole YPLibraryVC now works on the selection property only.
I think it's much clearer now to understand and to work on further.
Again, I myself couldn't find any bugs after those changes, be it on simulator or actual device. But without automated tests I really cannot be sure ;)

@s4cha s4cha merged commit c20697b into Yummypets:master Dec 10, 2018
@s4cha
Copy link
Member

s4cha commented Dec 10, 2018

I don't remember why I did that at the time, our guidelines were always to stick with what instagram does and they allow empty selection so it's a win :) Thanks @mpiechocki for this !! 🚀

LucasDang pushed a commit to pukapp/secret-ios-YPImagePicker that referenced this pull request Feb 10, 2022
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.

can`t deselect 1 image if the max allowed image is more than 1
3 participants