// // UINavigationController+Expand.m // DDTG // // Created by 翟玉磊 on 16/6/15. // Copyright © 2016年 翟玉磊. All rights reserved. // #import "UINavigationController+Expand.h" //#import "LoginViewController.h" @implementation UINavigationController (Expand) + (void)load { // SEL originalSelector = @selector(pushViewController:animated:); // SEL swizzledSelector = @selector(swizzled_pushViewController:animated:); // // [DDYHookUtility SwizzlingInClass:[self class] originalSelector:originalSelector swizzledSelector:swizzledSelector]; // // SEL originalSelectorPop = @selector(popViewControllerAnimated:); // SEL swizzledSelectorPop = @selector(swizzled_popViewControllerAnimated:); // // [DDYHookUtility SwizzlingInClass:[self class] originalSelector:originalSelectorPop swizzledSelector:swizzledSelectorPop]; } #pragma mark - Method Swizzling - (void)swizzled_pushViewController:(UIViewController *)viewController animated:(BOOL)animated { // if ([CacheStaue getExitType] == 2 && [viewController isKindOfClass:[LoginViewController class]]) { // return; // } // if ([viewController isKindOfClass:[LoginViewController class]]) { // [CacheStaue setExitType:2]; // } // [self swizzled_pushViewController:viewController animated:animated]; } - (void)swizzled_popViewControllerAnimated:(BOOL)animated { // NSLog(@"pop_CacheStaue:%d",[CacheStaue getExitType]); // [CacheStaue setExitType:1]; // [self swizzled_popViewControllerAnimated:animated]; } @end