|
|
@ -91,12 +91,19 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
|
// if a view has unsaved changes.
|
|
|
|
// if a view has unsaved changes.
|
|
|
|
- (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer
|
|
|
|
- (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
OWSAssert(gestureRecognizer == self.interactivePopGestureRecognizer);
|
|
|
|
|
|
|
|
|
|
|
|
UIViewController *topViewController = self.topViewController;
|
|
|
|
UIViewController *topViewController = self.topViewController;
|
|
|
|
if ([topViewController conformsToProtocol:@protocol(OWSNavigationView)]) {
|
|
|
|
if ([topViewController conformsToProtocol:@protocol(OWSNavigationView)]) {
|
|
|
|
id<OWSNavigationView> navigationView = (id<OWSNavigationView>)topViewController;
|
|
|
|
id<OWSNavigationView> navigationView = (id<OWSNavigationView>)topViewController;
|
|
|
|
return ![navigationView shouldCancelNavigationBack];
|
|
|
|
return ![navigationView shouldCancelNavigationBack];
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
return YES;
|
|
|
|
UIViewController *rootViewController = self.viewControllers.firstObject;
|
|
|
|
|
|
|
|
if (topViewController == rootViewController) {
|
|
|
|
|
|
|
|
return NO;
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
return YES;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|