mwaterfall / MWPhotoBrowser

A simple iOS photo and video browser with grid view, captions and selections.
MIT License
8.75k stars 2.71k forks source link

Using MWPhotoBrowser without grid view #222

Open jasonchutko opened 10 years ago

jasonchutko commented 10 years ago

As of 68ba43ae9a9b577dbb71a680e38471a62b803869, there is now a check for whether the photo browser has belonged to a viewController. In our application, we are using a custom grid view, then pushing the photo browser to display the image. This commit breaks that functionality, claiming that "MWPhotoBrowsers instances cannot be reused." when we push, pop, then push the same view controller.

What kind of inconsistency is found by using it in this behavior? Is there a proper way to do what we are trying to do?

mwaterfall commented 10 years ago

Hi @jasonchutko, thanks for the message. The inconsistency is reusing a photo browser instance to display a different number of photos. I will need to re-architect a few things to make reusing the browser safe, so instead of making it possible for users to easily put the photo browser in a buggy, unknown state, I chose to detect reuse and throw an exception.

Perhaps for now the best thing for you to do is fork and remove the checks added, as long as you always show the same number of photos between presentations of the browser.

Hope this sheds some light on the issue.

jasonchutko commented 10 years ago

Thanks for the explanation!

huben92 commented 10 years ago

Thanks, i remove the exeption and everything just fine