Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

A modern photo viewing experience for iOS.

License

NotificationsYou must be signed in to change notification settings

nytimes/NYTPhotoViewer

Repository files navigation

Carthage compatible

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.

Demo GIF

Usage

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 = [[NYTPhotosViewControlleralloc]initWithPhotos:photos];[selfpresentViewController:photosViewControlleranimated:YEScompletion:nil];

Running the Example

Clone this locally, then in your local workspace of theNYTPhotoViewer repo, run./scripts/bootstrap, then open Examples/NYTPhotoViewer.xcworkspace. You'll see targets for a Swift and Objective-C app.

Installation

Swift Package Manager

NYTPhotoViewer may be installed via SPM, by pointing at this repo's URL.

Cocoapods

NYTPhotoViewer is available throughCocoaPods. To install it, simply add the following line to yourPodfile:

pod'NYTPhotoViewer'

Carthage

NYTPhotoViewer may be installed viaCarthage. To install it, simply add the following line to yourCartfile:

github "NYTimes/NYTPhotoViewer"

Then, following the instructions forintegrating Carthage frameworks into your app, link theNYTPhotoViewer andPINRemoteImage frameworks into your project.

If you don't want support for animated GIFs, you may instead link against only theNYTPhotoViewerCore framework.

Requirements

This library requires a deployment target of iOS 9.0 or greater.

Changelog

SeeCHANGELOG.md.

Contributing

Pleaseopen pull requests against thedevelop branch, and add a relevant note to thedevelop section of the CHANGELOG as part of your pull request.

Swift

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.

Inspiration

NYTPhotoViewer draws feature inspiration from Facebook and Tweetbot’s image viewers. If this implementation isn’t to your liking, you may considerJTSImageViewController orIDMPhotoBrowser.

Implementation

NYTPhotoViewer has a straightforward implementation using standard UIKit components. The viewer is aUIViewController and usesUIViewController transitioning APIs for the animated and interactive transitions, aUIPageViewController for horizontal swiping between images, andUIScrollView for image zooming.

It is intended to be used without the need for subclassing, and as such it accepts model objects conforming to aNYTPhoto protocol and provides ample opportunity for customization via theNYTPhotosViewControllerDelegate. Since standard APIs are used, the client has full control over the transitions and customization of theNYTPhotosViewController.

License

NYTPhotoViewer is available under the Apache 2.0 license. SeeLICENSE.md for more information.

Contributors

A list of contributors is available through GitHub.

About

A modern photo viewing experience for iOS.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors40

Languages


[8]ページ先頭

©2009-2025 Movatter.jp