Created
April 12, 2019 13:23
-
-
Save SergLam/36461ebfc8847d60a363698efa7023bd to your computer and use it in GitHub Desktop.
Check if viewController isModal
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
func isModal() -> Bool { | |
let presentingIsModal = presentingViewController != nil | |
let presentingIsNavigation = navigationController?.presentingViewController?.presentedViewController == navigationController | |
let presentingIsTabBar = tabBarController?.presentingViewController is UITabBarController | |
return presentingIsModal || presentingIsNavigation || presentingIsTabBar | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment