Facebook-like iOS Photo Modal Gallery (With Swipe Gestures)
If you haven’t seen it, when you tap a photo you get a modal dialog and you can swipe images back and forth as well as pinch to zoom.
Originally published on the rexstjohn.com blog

- ios
Originally published at rexstjohn.com on December 25, 2013. Recovered from the Internet Archive.
Facebook has a neat photo gallery in their mobile app.
If you haven’t seen it, when you tap a photo you get a modal dialog and you can swipe images back and forth as well as pinch to zoom. Replicating this effect is a much larger pain than one might anticipate, especially in the world of AutoLayout where a misplaced constraint can ruin the whole thing.
Here is a working implementation, feel free to use it for your own purposes. It also handles device rotations gracefully.
Make sure you have Cocoapods and run “pod install.” When you run it, things should work properly.
Get it here: <https://github.com/rexstjohn/Scanplay/tree/master/iOS/PhotoViewer>
PS, Merry Christmas (eve)