Created
September 22, 2015 22:39
-
-
Save evgeniyd/cf31cf4eb420a69b8a61 to your computer and use it in GitHub Desktop.
A small function to check UIAlertView is shown (based on SO answer: http://stackoverflow.com/a/15151877/1492173)
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
private func isAlertExist() -> Bool { | |
for window in UIApplication.sharedApplication().windows { | |
if let w = window as? UIWindow where w.subviews.count > 0 { | |
for subview in w.subviews { | |
if let s = subview as? UIAlertView { | |
return true | |
} | |
} | |
} | |
} | |
return false | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment