Skip to content

Commit

Permalink
Issue nytimes#72
Browse files Browse the repository at this point in the history
  • Loading branch information
lpenaflor committed Dec 4, 2015
1 parent 1bcc3f8 commit 1c6b940
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
5 changes: 5 additions & 0 deletions Pod/Classes/ios/NYTPhotosViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,11 @@ extern NSString * const NYTPhotosViewControllerDidDismissNotification;
*/
- (void)photosViewController:(NYTPhotosViewController *)photosViewController actionCompletedWithActivityType:(NSString * _Nullable)activityType;

/**
* Dismisses `NYTPhotosViewController`. Should only be used in cases where user interaction of a button in the captionView requires a different viewController to be modal.
*/
- (void)forceDismiss;

@end

NS_ASSUME_NONNULL_END
10 changes: 7 additions & 3 deletions Pod/Classes/ios/NYTPhotosViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -240,9 +240,7 @@ - (void)updateOverlayInformation {
}

- (void)doneButtonTapped:(id)sender {
self.transitionController.forcesNonInteractiveDismissal = YES;
[self setOverlayViewHidden:YES animated:NO];
[self dismissAnimated:YES];
[self forceDismiss];
}

- (void)actionButtonTapped:(id)sender {
Expand Down Expand Up @@ -338,6 +336,12 @@ - (void)didPanWithGestureRecognizer:(UIPanGestureRecognizer *)panGestureRecogniz
}
}

- (void)forceDismiss {
self.transitionController.forcesNonInteractiveDismissal = YES;
[self setOverlayViewHidden:YES animated:NO];
[self dismissAnimated:YES];
}

- (void)dismissAnimated:(BOOL)animated {
UIView *startingView;
if (self.currentlyDisplayedPhoto.image || self.currentlyDisplayedPhoto.placeholderImage) {
Expand Down

0 comments on commit 1c6b940

Please sign in to comment.