Hello,
I am using popover controllers for all devices and UI traits. According to sources on the internet this how you express to the SDK that you wish to use popovers on all devices. Unfortunately the 7plus (simulater ond device) converts the popover into a partially offscreen modal form sheet on rotation. The expected willRepositionPopoverTo delegate method is not called (nor any pther delegate methods) only on the 7p. All other simuated devices work as expected. I am targetting iOS 10 and iOS9. I have not tried on earlier targets yet.
Any advice or workaround is appreciated
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
segue.destination.modalPresentationStyle = UIModalPresentationStyle.popover
destination.popoverPresentationController!.delegate = self
}
func adaptivePresentationStyle(for controller: UIPresentationController) -> UIModalPresentationStyle {
return UIModalPresentationStyle.none
}
public func popoverPresentationController(_ popoverPresentationController: UIPopoverPresentationController,
willRepositionPopoverTo rect: UnsafeMutablePointer<CGRect>,
in view: AutoreleasingUnsafeMutablePointer<UIView>) {
// Not called for iPhone 7 plus. Popover is transformed into a partially off screen form sheet instead.
}