Created
October 7, 2014 20:12
-
-
Save rcfrias/aaca74180428ab9b0b4b to your computer and use it in GitHub Desktop.
Getting the Top-most View Controller on an iOS Application
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 *topViewController = [UIApplication sharedApplication].keyWindow.rootViewController; | |
while (topViewController.presentedViewController) { | |
topViewController = topViewController.presentedViewController; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment