Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,37 @@ - (BOOL)gestureRecognizerShouldBegin:(UIPanGestureRecognizer *)gestureRecognizer
return YES;
}

- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer
shouldBeRequiredToFailByGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer
{
if (gestureRecognizer == self.navigationController.fd_fullscreenPopGestureRecognizer)
{
// Ignore when the beginning location is beyond max allowed initial distance to left edge.
UIViewController *topViewController = self.navigationController.viewControllers.lastObject;
CGFloat maxAllowedInitialDistance = topViewController.fd_interactivePopMaxAllowedInitialDistanceToLeftEdge;

CGPoint beginningLocation = [gestureRecognizer locationInView:gestureRecognizer.view];

if (maxAllowedInitialDistance > 0 && beginningLocation.x > maxAllowedInitialDistance) {
return NO;
}

return YES;
}
return NO;
}

- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer
shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer
{
if (gestureRecognizer == self.navigationController.fd_fullscreenPopGestureRecognizer ||
otherGestureRecognizer == self.navigationController.fd_fullscreenPopGestureRecognizer)
{
return YES;
}
return NO;
}

@end

typedef void (^_FDViewControllerWillAppearInjectBlock)(UIViewController *viewController, BOOL animated);
Expand Down Expand Up @@ -108,12 +139,14 @@ - (void)fd_viewWillDisappear:(BOOL)animated
// Forward to primary implementation.
[self fd_viewWillDisappear:animated];

dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
UIViewController *viewController = self.navigationController.viewControllers.lastObject;
if (viewController && !viewController.fd_prefersNavigationBarHidden) {
[self.navigationController setNavigationBarHidden:NO animated:NO];
}
});
if (self.navigationController.fd_viewControllerBasedNavigationBarAppearanceEnabled) {
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
UIViewController *viewController = self.navigationController.viewControllers.lastObject;
if (viewController && !viewController.fd_prefersNavigationBarHidden) {
[self.navigationController setNavigationBarHidden:NO animated:NO];
}
});
}
}

- (_FDViewControllerWillAppearInjectBlock)fd_willAppearInjectBlock
Expand Down Expand Up @@ -235,8 +268,7 @@ - (BOOL)fd_viewControllerBasedNavigationBarAppearanceEnabled
if (number) {
return number.boolValue;
}
self.fd_viewControllerBasedNavigationBarAppearanceEnabled = YES;
return YES;
return NO;
}

- (void)setFd_viewControllerBasedNavigationBarAppearanceEnabled:(BOOL)enabled
Expand Down