Sometimes my app crashes when two UIAlertViews
are trying to be presented at the same time. How do I check if another UIAlertview
is being shown before showing another one?
Here is what I tried, but it doesn't work.
Note: I'm using swift for this project.
if ViewController.isVisable == false {
self.presentViewController(AlertView, animated: true, completion: nil)
}
As a strict response to your question you could check if the ViewController
's view has his window:
if ViewController.view.window != nil {
}
Anyway I encourage you to take @Wain ' s advice.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With