From 5cdbcf10c2ec915a011273f926c00def3aea10c2 Mon Sep 17 00:00:00 2001 From: Datius Date: Thu, 19 May 2016 12:28:34 +0400 Subject: [PATCH] Update NYTPhotoDismissalInteractionController.m Fixes issue, when you trying to dismiss NYTPhotoViewer (being landscape), which presented by portrait-only controller. In that case panGestureRecognizer.state turns to "cancelled". We should treat that state the same way as "ended", because by the fact it ended. Probably, there can be many other cases, which will be fix by this line of code. Can be reproduced: iOS >= 8.0 I can provide video with "steps to reproduce", if you need this. --- NYTPhotoViewer/NYTPhotoDismissalInteractionController.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NYTPhotoViewer/NYTPhotoDismissalInteractionController.m b/NYTPhotoViewer/NYTPhotoDismissalInteractionController.m index 433f51c9..d8c9f14a 100644 --- a/NYTPhotoViewer/NYTPhotoDismissalInteractionController.m +++ b/NYTPhotoViewer/NYTPhotoDismissalInteractionController.m @@ -35,7 +35,7 @@ - (void)didPanWithPanGestureRecognizer:(UIPanGestureRecognizer *)panGestureRecog CGFloat backgroundAlpha = [self backgroundAlphaForPanningWithVerticalDelta:verticalDelta]; fromView.backgroundColor = [fromView.backgroundColor colorWithAlphaComponent:backgroundAlpha]; - if (panGestureRecognizer.state == UIGestureRecognizerStateEnded) { + if (panGestureRecognizer.state == UIGestureRecognizerStateEnded || panGestureRecognizer.state == UIGestureRecognizerStateCancelled) { [self finishPanWithPanGestureRecognizer:panGestureRecognizer verticalDelta:verticalDelta viewToPan:viewToPan anchorPoint:anchorPoint]; } }