Created
July 5, 2015 13:14
-
-
Save dzenbot/95d6e0805b8f0afd64a9 to your computer and use it in GitHub Desktop.
Gets the appropriate View Controller to present from and play nice with view hierarchy
This file contains 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
- (UIViewController *)appropriatePresentationViewController | |
{ | |
UIViewController *rootviewController = [UIApplication sharedApplication].keyWindow.rootViewController; | |
return rootviewController.presentedViewController ? : rootviewController; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment