//MainVIEwControlleroverrIDe func prepareForSegue(segue: UIStoryboardSegue,sender: AnyObject?){ if segue.IDentifIEr == "GoToSecondVIEwControllerSegue" { var vc = segue.destinationVIEwController as! SecondVIEwController var controller = vc.popoverPresentationController if controller != nil { controller?.delegate = self vc.inputTextDelegate = "I'm a popover!" } }}func popoverPresentationControllerDIDdismisspopover(popoverPresentationController: UIPopoverPresentationController) { println("done")}func adaptivePresentationStyleForPresentationController(controller: UIPresentationController) -> UIModalPresentationStyle{ return .None}
//SecondVIEwController@IBAction func dismisspopover(sender: UIbutton) { dismissVIEwControllerAnimated(true,completion: nil) //This dismisses the popover but does not notify the MainVIEwConroller}
segue的锚点连接到一个按钮:
现在我有两个问题:
>当我点击popover内的取消按钮时,它会解除d出窗口但不会在MainVIEwController中触发popoverPresentationControllerDIDdismisspopover
>我如何将数据从SecondVIEwController传递到MainVIEwController,例如UITextVIEw的文本值.
dismissVIEwControllerAnimated(true,completion: nil) popoverPresentationController?.delegate?.popoverPresentationControllerDIDdismisspopover?(popoverPresentationController!)总结
以上是内存溢出为你收集整理的Swift:Popover解雇回调全部内容,希望文章能够帮你解决Swift:Popover解雇回调所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)