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

Rename …didDisplayPhoto… to …didNavigateToPhoto… #47

Merged
merged 1 commit into from
May 1, 2015
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions Example/NYTPhotoViewer-Swift/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ class ViewController: UIViewController, NYTPhotosViewControllerDelegate {
return nil
}

func photosViewController(photosViewController: NYTPhotosViewController!, didDisplayPhoto photo: NYTPhoto!, atIndex photoIndex: UInt) {
println("Did Display Photo: \(photo) identifier: \(photoIndex)")
func photosViewController(photosViewController: NYTPhotosViewController!, didNavigateToPhoto photo: NYTPhoto!, atIndex photoIndex: UInt) {
println("Did Navigate To Photo: \(photo) identifier: \(photoIndex)")
}

func photosViewController(photosViewController: NYTPhotosViewController!, actionCompletedWithActivityType activityType: String!) {
Expand Down
4 changes: 2 additions & 2 deletions Example/NYTPhotoViewer/NYTViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ - (NSDictionary *)photosViewController:(NYTPhotosViewController *)photosViewCont
return nil;
}

- (void)photosViewController:(NYTPhotosViewController *)photosViewController didDisplayPhoto:(id <NYTPhoto>)photo atIndex:(NSUInteger)photoIndex {
NSLog(@"Did Display Photo: %@ identifier: %lu", photo, (unsigned long)photoIndex);
- (void)photosViewController:(NYTPhotosViewController *)photosViewController didNavigateToPhoto:(id <NYTPhoto>)photo atIndex:(NSUInteger)photoIndex {
NSLog(@"Did Navigate To Photo: %@ identifier: %lu", photo, (unsigned long)photoIndex);
}

- (void)photosViewController:(NYTPhotosViewController *)photosViewController actionCompletedWithActivityType:(NSString *)activityType {
Expand Down
4 changes: 2 additions & 2 deletions Pod/Classes/ios/NYTPhotosViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
@protocol NYTPhotosViewControllerDelegate;

// All notifications will have the `NYTPhotosViewController` instance set as the object.
extern NSString * const NYTPhotosViewControllerDidDisplayPhotoNotification;
extern NSString * const NYTPhotosViewControllerDidNavigateToPhotoNotification;
extern NSString * const NYTPhotosViewControllerWillDismissNotification;
extern NSString * const NYTPhotosViewControllerDidDismissNotification;

Expand Down Expand Up @@ -110,7 +110,7 @@ extern NSString * const NYTPhotosViewControllerDidDismissNotification;
* @param photo The photo object that was just displayed.
* @param photoIndex The index of the photo that was just displayed.
*/
- (void)photosViewController:(NYTPhotosViewController *)photosViewController didDisplayPhoto:(id <NYTPhoto>)photo atIndex:(NSUInteger)photoIndex;
- (void)photosViewController:(NYTPhotosViewController *)photosViewController didNavigateToPhoto:(id <NYTPhoto>)photo atIndex:(NSUInteger)photoIndex;

/**
* Called immediately before the photos view controller is about to start dismissal. This will be the beginning of the interactive panning to dismiss, if it is enabled and performed.
Expand Down
12 changes: 6 additions & 6 deletions Pod/Classes/ios/NYTPhotosViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#import "NYTPhotosOverlayView.h"
#import "NYTPhotoCaptionView.h"

NSString * const NYTPhotosViewControllerDidDisplayPhotoNotification = @"NYTPhotosViewControllerDidDisplayPhotoNotification";
NSString * const NYTPhotosViewControllerDidNavigateToPhotoNotification = @"NYTPhotosViewControllerDidNavigateToPhotoNotification";
NSString * const NYTPhotosViewControllerWillDismissNotification = @"NYTPhotosViewControllerWillDismissNotification";
NSString * const NYTPhotosViewControllerDidDismissNotification = @"NYTPhotosViewControllerDidDismissNotification";

Expand Down Expand Up @@ -371,12 +371,12 @@ - (NYTPhotoViewController *)newPhotoViewControllerForPhoto:(id <NYTPhoto>)photo
return nil;
}

- (void)didDisplayPhoto:(id <NYTPhoto>)photo {
if ([self.delegate respondsToSelector:@selector(photosViewController:didDisplayPhoto:atIndex:)]) {
[self.delegate photosViewController:self didDisplayPhoto:photo atIndex:[self.dataSource indexOfPhoto:photo]];
- (void)didNavigateToPhoto:(id <NYTPhoto>)photo {
if ([self.delegate respondsToSelector:@selector(photosViewController:didNavigateToPhoto:atIndex:)]) {
[self.delegate photosViewController:self didNavigateToPhoto:photo atIndex:[self.dataSource indexOfPhoto:photo]];
}

[[NSNotificationCenter defaultCenter] postNotificationName:NYTPhotosViewControllerDidDisplayPhotoNotification object:self];
[[NSNotificationCenter defaultCenter] postNotificationName:NYTPhotosViewControllerDidNavigateToPhotoNotification object:self];
}

- (id <NYTPhoto>)currentlyDisplayedPhoto {
Expand Down Expand Up @@ -439,7 +439,7 @@ - (void)pageViewController:(UIPageViewController *)pageViewController didFinishA
[self updateOverlayInformation];

UIViewController <NYTPhotoContainer> *photoViewController = pageViewController.viewControllers.firstObject;
[self didDisplayPhoto:photoViewController.photo];
[self didNavigateToPhoto:photoViewController.photo];
}
}

Expand Down