UINavigationController+Expand.m 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. //
  2. // UINavigationController+Expand.m
  3. // DDTG
  4. //
  5. // Created by 翟玉磊 on 16/6/15.
  6. // Copyright © 2016年 翟玉磊. All rights reserved.
  7. //
  8. #import "UINavigationController+Expand.h"
  9. //#import "LoginViewController.h"
  10. @implementation UINavigationController (Expand)
  11. + (void)load {
  12. // SEL originalSelector = @selector(pushViewController:animated:);
  13. // SEL swizzledSelector = @selector(swizzled_pushViewController:animated:);
  14. //
  15. // [DDYHookUtility SwizzlingInClass:[self class] originalSelector:originalSelector swizzledSelector:swizzledSelector];
  16. //
  17. // SEL originalSelectorPop = @selector(popViewControllerAnimated:);
  18. // SEL swizzledSelectorPop = @selector(swizzled_popViewControllerAnimated:);
  19. //
  20. // [DDYHookUtility SwizzlingInClass:[self class] originalSelector:originalSelectorPop swizzledSelector:swizzledSelectorPop];
  21. }
  22. #pragma mark - Method Swizzling
  23. - (void)swizzled_pushViewController:(UIViewController *)viewController animated:(BOOL)animated {
  24. // if ([CacheStaue getExitType] == 2 && [viewController isKindOfClass:[LoginViewController class]]) {
  25. // return;
  26. // }
  27. // if ([viewController isKindOfClass:[LoginViewController class]]) {
  28. // [CacheStaue setExitType:2];
  29. // }
  30. // [self swizzled_pushViewController:viewController animated:animated];
  31. }
  32. - (void)swizzled_popViewControllerAnimated:(BOOL)animated {
  33. // NSLog(@"pop_CacheStaue:%d",[CacheStaue getExitType]);
  34. // [CacheStaue setExitType:1];
  35. // [self swizzled_popViewControllerAnimated:animated];
  36. }
  37. @end