问题描述
FDFullscreenPopGesture
是iOS平台上很方便使用左滑手势退出的三方库,在使用FDFullscreenPopGesture
会出现与其他三方库冲突,导航栏隐藏不了,或者按钮都显示。
看一遍源码了解其实现,解决这种冲突问题。
处理方法
修改源码
源码是通过交换push
方法实现,若想不影响某个视图,就直接调用原push
方法就可以了。
- (void)fd_pushViewController:(UIViewController *)viewController animated:(BOOL)animated
{
if ([self isKindOfClass:[你的导航栏类 class]]) {
[self fd_pushViewController:viewController animated:animated];
return;
}
https://github.com/forkingdog/FDFullscreenPopGesture/issues/12
不修改源码
1.查看堆栈调用
(lldb) bt
* thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 4.1
* frame #0: 0x00000001010fa608 FastDemo`-[UINavigationController(self=0x000000010384ac00, _cmd="setFd_viewControllerBasedNavigationBarAppearanceEnabled:", enabled=YES) setFd_viewControllerBasedNavigationBarAppearanceEnabled:] at UINavigationController+FDFullscreenPopGesture.m:200 [opt]
frame #1: 0x00000001010fa5d0 FastDemo`-[UINavigationController(self=0x000000010384ac00, _cmd=<unavailable>) fd_viewControllerBasedNavigationBarAppearanceEnabled] at UINavigationController+FDFullscreenPopGesture.m:193 [opt]
frame #2: 0x00000001010fa28c FastDemo`-[UINavigationController(self=0x000000010384ac00, _cmd=<unavailable>, appearingViewController=<unavailable>) fd_setupViewControllerBasedNavigationBarAppearanceIfNeeded:] at UINavigationController+FDFullscreenPopGesture.m:139 [opt]
frame #