Guest User

Untitled

a guest
Oct 20th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.20 KB | None | 0 0
  1. @interface WYNavigationController ()<UINavigationControllerDelegate, UIGestureRecognizerDelegate>
  2.  
  3. @end
  4.  
  5. @implementation WYNavigationController
  6.  
  7. - (void)viewDidLoad {
  8. [super viewDidLoad];
  9.  
  10. self.delegate = self;
  11.  
  12. id target = self.interactivePopGestureRecognizer.delegate;
  13. UIPanGestureRecognizer *pan = [[UIPanGestureRecognizer alloc] initWithTarget:target action:@selector(handleNavigationTransition:)];
  14. [self.view addGestureRecognizer:pan];
  15. self.interactivePopGestureRecognizer.enabled = NO;
  16. }
  17.  
  18. - (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated
  19. {
  20. if (self.viewControllers.count > 0) {
  21. viewController.hidesBottomBarWhenPushed = YES;
  22. }
  23. [super pushViewController:viewController animated:animated];
  24. }
  25.  
  26.  
  27. #pragma mark - UINavigationControllerDelegate
  28. - (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated {
  29. BOOL isHideNav = ([viewController isKindOfClass:[ViewController class]] || [viewController isKindOfClass:[WYTargetVC class]]);
  30.  
  31. NSLog(@"isHide = %d", isHideNav);
  32. [self setNavigationBarHidden:isHideNav animated:YES];
  33. }
Add Comment
Please, Sign In to add comment