Warning: Attempt to present * on * which is already presenting (null)

后端 未结 16 620
盖世英雄少女心
盖世英雄少女心 2021-02-03 17:14

This is my first application for iOS.

So I have a UIVIewController with a UITableView where I have integrated a UISearchBar and a

16条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-02-03 17:43

    What worked for me was to add the presentation of the alert to the main thread.

    DispatchQueue.main.async {
       self.present(alert, animated: true)
    }
    

    The presentation of the current viewController was not complete. By adding the alert to the main thread it can wait for the viewController's presentation to complete before attempting to present.

提交回复
热议问题