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

3 participants
@mpiechocki
Copy link
Contributor

commented Oct 15, 2018

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

This comment has been minimized.

Copy link
Contributor Author

commented Oct 15, 2018

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

@NikKovIos

This comment has been minimized.

Copy link
Collaborator

commented Oct 15, 2018

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

This comment has been minimized.

Copy link
Contributor Author

commented Oct 15, 2018

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

This comment has been minimized.

Copy link
Contributor Author

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

1 check passed

codebeat 4 issues resolved and 1 introduced
Details
@s4cha

This comment has been minimized.

Copy link
Member

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 !! 🚀

@s4cha s4cha added this to Done in Next version Dec 28, 2018

@s4cha s4cha moved this from Done to Deployed in version 3.5.3 in Next version Jan 2, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.