爆米花不';iphone上的t显示

爆米花不';iphone上的t显示,iphone,uikit,ios10,uipopovercontroller,popover,Iphone,Uikit,Ios10,Uipopovercontroller,Popover,我遵循了这一点,但没有在iphone上制作popover。 这是viewcontroller的代码 class ViewController:UIViewController,UIPopoverPresentationControllerDelegate{ override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view

我遵循了这一点,但没有在iphone上制作popover。 这是viewcontroller的代码

class ViewController:UIViewController,UIPopoverPresentationControllerDelegate{

    override func viewDidLoad() {
        super.viewDidLoad()

        // Do any additional setup after loading the view.
    }

    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {

        if segue.identifier == "second"{

            let secondVC = segue.destination
            let controller : UIPopoverPresentationController = secondVC.popoverPresentationController!
            controller.delegate = self
        }
    }

    /* Popover delegate method */
    func adaptivePresentationStyleForPresentationController(controller: UIPresentationController) -> UIModalPresentationStyle {
        return UIModalPresentationStyle.none
    }
}
我无法在iphone中使用present作为popover显示新的viewcontroller。(ios 10/xcode8)


使用此委托方法后,它将在iphone上生成popover

func adaptivePresentationStyle(for controller: UIPresentationController, traitCollection: UITraitCollection) -> UIModalPresentationStyle {

    return UIModalPresentationStyle.none
}

这个问题有点让人困惑:您说“iphone上不生成popover”(即popover不显示),但您将其命名为“未调用委托方法”。如果是前者(popover不显示),你能显示你(尝试)如何显示popover的代码吗?@MichaelDautermann I添加了故事板的屏幕截图。