Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated README with more detailed usage instructions #225

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,21 @@ NYTPhotoViewer is a slideshow and image viewer that includes double-tap to zoom,

## 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:
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 custom objects that implement the [NYTPhoto.h](https://github.com/NYTimes/NYTPhotoViewer/blob/develop/NYTPhotoViewer/Protocols/NYTPhoto.h) protocol and present it as normal.


```objc
#import "NYTPhotosViewController.h"

NYTPhotosViewController *photosViewController = [[NYTPhotosViewController alloc] initWithPhotos:photos];
[self presentViewController:photosViewController animated:YES completion:nil];
```

Sample object that adheres to the protocol: [NYTExamplePhoto.h](https://github.com/NYTimes/NYTPhotoViewer/blob/develop/Example/NYTExamplePhoto.h)

Sample code of creating the array of objects and displaying the ViewController: [NYTViewController.h](https://github.com/NYTimes/NYTPhotoViewer/blob/develop/Example/NYTViewController.m#L58)


## Installation

### Carthage
Expand Down