判断视图是pop还是push出来的
2016-08-11 本文已影响31人
0x00chen
NSArray * viewControllers =self.navigationController.viewControllers;
if (viewControllers.count>1 && [viewControllers objectAtIndex:viewControllers.count-2] ==self) {
NSLog(@"push");
}else if ([viewControllers indexOfObject:self]==NSNotFound){
NSLog(@"pop");
}