关闭PopOverViewController时,屏幕出现黑色闪烁。

ViewController.swift中的代码

 if segue.identifier == "addComment"
    {
               let controller = segue.destinationViewController as! ProfileCommentPopOver
                controller.popoverPresentationController?.delegate = self
                controller.preferredContentSize = CGSizeMake(250, 150)
               controller.fetchedProfileID = sendToUserID
        }

PopOverViewController.swift
 @IBAction func addCommentAction(sender: UIButton)
{
                    self.dismissViewControllerAnimated(true, completion: nil)

}

最佳答案

尝试

@IBAction func addCommentAction(sender: UIButton)
{
     self.dismiss(animated: true, completion:{})
}

07-28 06:22