What is the best way to check if a UIAlertController is already presenting?

后端 未结 13 2059
后悔当初
后悔当初 2020-12-04 17:26

I have a tableview which, when loaded, each cell could possibly return an NSError, which I have chosen to display in a UIAlertController. Problem is I get this error in the

相关标签:
13条回答
  • 2020-12-04 18:04

    you can test - in a single line - if an alert is already presented:

    if self.presentedViewController as? UIAlertController != nil {
        print ("alert already presented")
    }
    
    0 讨论(0)
提交回复
热议问题