Created
August 15, 2016 10:41
-
-
Save kirsteins/b6c53d54c85297acf43d90601fd86989 to your computer and use it in GitHub Desktop.
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
/// Get the top most view controller in presentation chain | |
func topPresentedController() -> UIViewController? { | |
var topPresentedController = rootViewController | |
while let nextTopPresentedController = topPresentedController?.presentedViewController { | |
topPresentedController = nextTopPresentedController | |
} | |
return topPresentedController | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment