I am trying to use UIPopoverPresentationController
to display a popover
that doesn\'t take up the whole screen. I\'ve followed many different tutor
There's also the possibility to show the popover on IPhone's as fullscreen and on IPad's as a popover.
Just return .popover
for adaptivePresentationStyle()
:
func adaptivePresentationStyle(for controller: UIPresentationController) -> UIModalPresentationStyle {
return .popover
}
and set the popover-configuration like @mourodrigo did:
dialog.modalPresentationStyle = .popover
dialog.popoverPresentationController?.delegate = self
dialog.popoverPresentationController?.permittedArrowDirections = UIPopoverArrowDirection(rawValue: 0)
dialog.popoverPresentationController?.sourceView = view
dialog.popoverPresentationController?.sourceRect = view.frame