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 @@ -110,7 +110,9 @@ - (void)fd_viewWillDisappear:(BOOL)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) {
if (viewController &&
viewController.fd_prefersNavigationBarHiddenObject &&
!viewController.fd_prefersNavigationBarHidden) {
[self.navigationController setNavigationBarHidden:NO animated:NO];
}
});
Expand All @@ -126,6 +128,10 @@ - (void)setFd_willAppearInjectBlock:(_FDViewControllerWillAppearInjectBlock)bloc
objc_setAssociatedObject(self, @selector(fd_willAppearInjectBlock), block, OBJC_ASSOCIATION_COPY_NONATOMIC);
}

- (NSNumber *)fd_prefersNavigationBarHiddenObject {
return objc_getAssociatedObject(self, _cmd);
}

@end

@implementation UINavigationController (FDFullscreenPopGesture)
Expand Down Expand Up @@ -188,7 +194,7 @@ - (void)fd_setupViewControllerBasedNavigationBarAppearanceIfNeeded:(UIViewContro
__weak typeof(self) weakSelf = self;
_FDViewControllerWillAppearInjectBlock block = ^(UIViewController *viewController, BOOL animated) {
__strong typeof(weakSelf) strongSelf = weakSelf;
if (strongSelf) {
if (strongSelf && viewController.fd_prefersNavigationBarHiddenObject) {
[strongSelf setNavigationBarHidden:viewController.fd_prefersNavigationBarHidden animated:animated];
}
};
Expand Down Expand Up @@ -261,7 +267,7 @@ - (void)setFd_interactivePopDisabled:(BOOL)disabled

- (BOOL)fd_prefersNavigationBarHidden
{
return [objc_getAssociatedObject(self, _cmd) boolValue];
return [self.fd_prefersNavigationBarHiddenObject boolValue];
}

- (void)setFd_prefersNavigationBarHidden:(BOOL)hidden
Expand Down