解决办法:
1.对setViewControllers:animated:进行方法交换
SEL originalSelector1 = @selector(setViewControllers:animated:);
SEL swizzledSelector1 = @selector(fd_setViewControllers:animated:);
Method originalMethod1 = class_getInstanceMethod(class, originalSelector1);
Method swizzledMethod1 = class_getInstanceMethod(class, swizzledSelector1);
BOOL success = class_addMethod(class, originalSelector1, method_getImplementation(swizzledMethod1), method_getTypeEncoding(swizzledMethod1));
if (success) {
class_replaceMethod(class, swizzledSelector1, method_getImplementation(originalMethod1), method_getTypeEncoding(originalMethod1));
} else {
method_exchangeImplementations(originalMethod1, swizzledMethod1);
}
2.实现交换后的方法
- (void)fd_setViewControllers:(NSArray<UIViewController *> *)viewControllers animated:(BOOL)animated {
[self fd_setupViewControllerBasedNavigationBarAppearanceIfNeeded:viewControllers.lastObject];
[self fd_setViewControllers:viewControllers animated:animated];
}
标签:FDFullscreenPopGesture,swizzledMethod1,class,setViewControllers,跳转,originalMetho From: https://www.cnblogs.com/yang-shuai/p/17762026.html