I'm using your DrawerController , thank you for awesome library.
My issue:
I'm using KYDrawerController with UITabbarController, I need to get Top Most controller of the application which is showing now but I'm not able to get correct one.
here is the code I'm using.
extension UIViewController {
func topMostViewController() -> UIViewController {
if let navigation = self.presentedViewController as? UINavigationController {
if let visibleController = navigation.visibleViewController {
return visibleController.topMostViewController()
}
}
if let tab = self.presentedViewController as? UITabBarController {
if let selectedTab = tab.selectedViewController {
return selectedTab.topMostViewController()
}
return tab.topMostViewController()
}
if self.presentedViewController == nil {
return self
}
return self.presentedViewController!.topMostViewController()
}
}
extension UIApplication {
func topMostViewController() -> UIViewController? {
return self.keyWindow?.rootViewController?.topMostViewController()
}
}
I'm using your DrawerController , thank you for awesome library. My issue:
I'm using KYDrawerController with UITabbarController, I need to get Top Most controller of the application which is showing now but I'm not able to get correct one.
here is the code I'm using.
Please correct me if I'm using wrong approch.