I am using the new popOverPresentationController
to present UIPopOverController
in iOS 8.
I set the popOverLayoutMargins
with a value like {65.0, 10.0, 45.0, 10.0}.
But these do not reflect when I present the popOverController. This used to work perfectly on iOS 7.
Is this broken on ios 8?
Regards, Harikant Jammi
Since iOS 9, UIPopoverController is deprecated. Time to look at UIPopoverPresentationController, which has been introduced in iOS 8. Presenting a controller as a popover is very straightforward with UIPopoverPresentationController.
A popover presentation controller notifies your delegate at appropriate points during the presentation process. You can use the delegate methods to customize this process and respond to changes dynamically. The margins that define the portion of the screen in which it is permissible to display the popover.
From the time a popover is presented until the time it is dismissed, UIKit uses an instance of this class to manage the presentation behavior. You use instances of this class as-is to configure aspects of the popover appearance and behavior for view controllers whose presentation style is set to UIModalPresentationStyle.popover.
In the default configuration the popover is presented as a modal view controller on the iPhone. However, if you return UIModalPresentationStyle.None in the adaptivePresentationStyleForPresentationController method of the UIPopoverPresentationControllerDelegate , you can present a popover also on the iPhone.
It is an Apple bug which has not yet been fixed. References to the bug can be found in this example code and on the Apple developer forums.
There is currently no clear workaround for this issue. A bug report with ID 18392444 has been filed with Apple.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With