Skip to content

Instantly share code, notes, and snippets.

@congbo
Last active August 29, 2015 14:16
Show Gist options
  • Save congbo/90f9983d43749fbb7d76 to your computer and use it in GitHub Desktop.
Save congbo/90f9983d43749fbb7d76 to your computer and use it in GitHub Desktop.
判断当前viewcontroller是push还是modal展示的
- (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