Skip to content

Instantly share code, notes, and snippets.

@evgeniyd
Created September 22, 2015 22:39
Show Gist options
  • Save evgeniyd/cf31cf4eb420a69b8a61 to your computer and use it in GitHub Desktop.
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)
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