Je souhaite afficher un contrôleur de vue dans un contrôleur de vue. J'utilise le popup segue pour faire ça. Les paramètres des contrôleurs de deuxième vue sont comme ci-dessous et mais il apparaît en plein écran de toute façon.Popup s'affiche en plein écran
func tappedView3() {
// get a reference to the view controller for the popover
let popController = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "popoverId")
// 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 = m_tumgun // button
popController.popoverPresentationController?.sourceRect = m_tumgun.bounds
// present the popover
self.present(popController, animated: true, completion: nil)
}
// UIPopoverPresentationControllerDelegate method
func adaptivePresentationStyleForPresentationController(controller: UIPresentationController) -> UIModalPresentationStyle {
// Force popover style
return UIModalPresentationStyle.none
}
https://stackoverflow.com/a/39975346/1702413 – TonyMkenu