thiagoperes / IDMPhotoBrowser

Photo Browser / Viewer inspired by Facebook's and Tweetbot's with ARC support, swipe-to-dismiss, image progress and more
MIT License
2.71k stars 641 forks source link

MWPhotoBrowser compatibility. #262

Open AndyIbanez opened 7 years ago

AndyIbanez commented 7 years ago

I was using MWPhotoBrowser for a very long time, but when I noticed it hasn't been updated for over year, I decided to use this fork instead.

I was able to quickly adapt most of my code for IDMPhotoBrowser, but there's a few things that are bothering me.

My app can download images as the user swipes images in the photo browser. To be able to do this, MWPhotoBrowser provided some delegate methods:

numberOfPhotos(in photoBrowser: MWPhotoBrowser!)
 photoBrowser(_ photoBrowser: MWPhotoBrowser!, photoAt index: UInt)

When I detected the user was watching the last picture, I downloaded more dynamically by checking the current index of the photo, loading more, and then refreshing the photoBrowser

photoBrowser.reloadData()

So the user could swipe through an infinite amount of pictures as more were added dynamically without having to close the photo browser.

My code still has the delegate methods, but for some reason they do not get called on IDM despite having protocols available.