Created
September 29, 2016 22:05
-
-
Save masters3d/29b9b0c8a8255d46b717f1a1fe1f1476 to your computer and use it in GitHub Desktop.
IsAlertShowing
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 { | |
var appDelegate:AppDelegate { | |
return UIApplication.shared.delegate as! AppDelegate | |
} | |
var isAlertShowingComputed:Bool { | |
guard let window = self.appDelegate.window else { return false } | |
return !window.subviews.filter{ | |
$0.isKind(of: UIAlertController.self)}.isEmpty | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment