-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
add this :
else if (rootViewController is SWRevealViewController) {
return topViewControllerWithRootViewController((rootViewController as! SWRevealViewController).frontViewController)
}
in to topViewControllerWithRootViewController.
will work correctly with SWRevealViewController.
final code:
private func topViewControllerWithRootViewController(_ rootViewController: UIViewController!) -> UIViewController? {
if (rootViewController == nil) { return nil }
if (rootViewController is UITabBarController) {
return topViewControllerWithRootViewController((rootViewController as! UITabBarController).selectedViewController)
} else if (rootViewController is UINavigationController) {
return topViewControllerWithRootViewController((rootViewController as! UINavigationController).visibleViewController)
} else if (rootViewController.presentedViewController != nil) {
return topViewControllerWithRootViewController(rootViewController.presentedViewController)
}else if (rootViewController is SWRevealViewController) {
return topViewControllerWithRootViewController((rootViewController as! SWRevealViewController).frontViewController)
}
return rootViewController
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels