Last active
August 29, 2015 14:16
-
-
Save congbo/90f9983d43749fbb7d76 to your computer and use it in GitHub Desktop.
判断当前viewcontroller是push还是modal展示的
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (BOOL)isModal { | |
return self.presentingViewController.presentedViewController == self | |
|| self.navigationController.presentingViewController.presentedViewController == self.navigationController | |
|| [self.tabBarController.presentingViewController isKindOfClass:[UITabBarController class]]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
http://stackoverflow.com/questions/2798653/is-it-possible-to-determine-whether-viewcontroller-is-presented-as-modal