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
| extension UIViewController { | |
| func topMostViewController() -> UIViewController { | |
| if self.presentedViewController == nil { | |
| return self | |
| } | |
| if let navigation = self.presentedViewController as? UINavigationController { | |
| return navigation.visibleViewController.topMostViewController() | |
| } | |
| if let tab = self.presentedViewController as? UITabBarController { | |
| if let selectedTab = tab.selectedViewController { |