我想从这样的PIC按钮进行酥料饼:酥料饼 - 斯威夫特
要做到这一点,我按照以下步骤进行:
1。我创建的视图控制器(加上一个控制器)与我改变大小它为100 * 200
2.I做出赛格瑞从第一控制器(JobsViewController
)上述控制器作为present as popover
和予设定的标识符:
3.in JobsViewController
:
func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
if segue.identifier == "showFeatureJobs" {
//let popoverViewController = segue.destination
// popoverViewController.modalPresentationStyle = UIModalPresentationStyle.popover
// popoverViewController.popoverPresentationController!.delegate = self
// get a reference to the view controller for the popover
let popController = UIStoryboard(name: "JobsViewController", bundle: nil).instantiateViewController(withIdentifier: "showFeatureJobs")
// set the presentation style
popController.modalPresentationStyle = UIModalPresentationStyle.popover
// set up the popover presentation controller
popController.popoverPresentationController?.permittedArrowDirections = UIPopoverArrowDirection.up
popController.popoverPresentationController?.delegate = self
popController.popoverPresentationController?.sourceView = sender as! UIView? // button
popController.popoverPresentationController?.sourceRect = (sender?.bounds)!
// present the popover
self.present(popController, animated: true, completion: nil)
}
}
// MARK: - UIPopoverPresentationControllerDelegate method
func adaptivePresentationStyleForPresentationController(controller: UIPresentationController) -> UIModalPresentationStyle {
// Force popover style
return UIModalPresentationStyle.none
}
4.but当我在我的按钮,我酥料饼盖点击我所有的网页:
哪里是我的问题?