解散PopOverViewController时黑色闪烁

时间:2016-07-23 05:51:58

标签: ios swift uipopovercontroller

我在解雇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)

}

Please check screenshot

1 个答案:

答案 0 :(得分:0)

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