NYTPhotoViewer is a slideshow and image viewer that includes double-tap to zoom, captions, support for multiple images, interactive flick to dismiss, animated zooming presentation, and more.
Usage is simple, with the option for more complicated customization when needed through a delegate relationship. In the most basic implementation, just initialize the view controller with an array of photo objects and present it as normal:
NYTPhotosViewController *photosViewController = [[NYTPhotosViewController alloc] initWithPhotos:photos]; [self presentViewController:photosViewController animated:YES completion:nil];
Running the Example
Then, in your checkout of the
NYTPhotoViewer repo, run
carthage checkout --use-submodules.
NYTPhotoViewer may be installed via Carthage. To install it, simply add the following line to your
Then, following the instructions for integrating Carthage frameworks into your app, link the
FLAnimatedImage frameworks into your project.
If you don't want support for animated GIFs, you may instead link against only the
NYTPhotoViewer is available through CocoaPods. To install it, simply add the following line to your
This library requires a deployment target of iOS 8.0 or greater.
Please open pull requests against the
develop branch, and add a relevant note to the
develop section of the CHANGELOG as part of your pull request.
NYTPhotoViewer is written in Objective-C but is fully interoperable with Swift. If you experience any interoperability difficulties, please open an issue or pull request and we will work to resolve it.
NYTPhotoViewer has a straightforward implementation using standard UIKit components. The viewer is a
UIViewController and uses
UIViewController transitioning APIs for the animated and interactive transitions, a
UIPageViewController for horizontal swiping between images, and
UIScrollView for image zooming.
It is intended to be used without the need for subclassing, and as such it accepts model objects conforming to a
NYTPhoto protocol and provides ample opportunity for customization via the
NYTPhotosViewControllerDelegate. Since standard APIs are used, the client has full control over the transitions and customization of the
Subscribe to iOS Example
Get the latest posts delivered right to your inbox