Warning: Attempt to present on <…> which is already presenting (null)

后端 未结 4 849
孤城傲影
孤城傲影 2021-02-07 02:00

I have a long press gesture set on a UITableView that presents a UIAlertController containing the cell\'s text. When the UIAlertController

4条回答
  •  甜味超标
    2021-02-07 02:29

    0

    Dismiss the current controller and present the alert controller like

    func alert(_ message:String) {
    let alert = UIAlertController(title: "Error!", message: message, preferredStyle: .alert)
    alert.addAction(UIAlertAction(title: "Dismiss", style: .default, handler: nil))
    self.dismiss(animated: false, completion: nil)
    self.present(alert, animated: true,completion: nil)
    }
    

提交回复
热议问题