iOS幻燈片和圖像查看器:NYTPhotoViewer

jopen 9年前發布 | 23K 次閱讀 iOS開發 移動開發 NYTPhotoViewer

NYTPhotoViewer是一個幻燈片和圖像查看器,包括支持雙擊縮放字幕支持多張圖片,互動輕擊駁回動畫縮放展示等等。

Implementation

NYTPhotoViewer has a very standard implementation using built-in frameworks. The viewer is aUIViewControllerand usesUIViewControllertransitioning APIs for the animated and interactive transitions, aUIPageViewControllerfor horizontal swiping between images, andUIScrollViewfor image zooming. It is intended to be used without the need for subclassing, and as such it accepts model objects conforming to aNYTPhotoprotocol 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.

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 = [[NYTPhotosViewController alloc] initWithPhotos:photos];
[self presentViewController:photosViewController animated:YES completion:nil];

Installation

NYTPhotoViewer is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "NYTPhotoViewer"

Requirements

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

Inspiration

NYTPhotoViewer draws feature inspiration from 非死book and Tweetbot's image viewers. If this implementation isn't to your liking, you may want to consider JTSImageViewController or IDMPhotoBrowser.

Swift

NYTPhotoViewer is written in Objective-C but is intended to be fully interoperable with Swift. If you experience any interoperability difficulties, please open an issue or pull request and we will work to resolve it quickly.

TODO

 本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
 轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
 本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!