Swift: Getting 'Snapshotting a view that has not been rendered..' error when trying to open a URL in safari from my app

前端 未结 8 1616
一整个雨季
一整个雨季 2020-12-28 12:48

One of the specifications of my app is that on tapping a tableView cell, the user will be redirected to the website associated with the cell. Here is the code:



        
8条回答
  •  孤城傲影
    2020-12-28 13:26

    To avoid copy/paste from Saliom's answer you can make such subclass and use it instead of UIAlertController:

    class AlertController: UIAlertController {
    
        override func viewWillAppear(animated: Bool) {
            super.viewWillAppear(animated)
            self.view.layoutIfNeeded()
        }
    
    }
    

提交回复
热议问题