Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Popover on iPhone
class PopoverOnIPhone: UIViewController {
required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
modalPresentationStyle = .Popover
presentationController?.delegate = self
// MARK: UIAdaptivePresentationControllerDelegate
extension PopoverOnIPhone : UIAdaptivePresentationControllerDelegate {
func adaptivePresentationStyleForPresentationController(PC: UIPresentationController) -> UIModalPresentationStyle {
// This *forces* a popover to be displayed on the iPhone
return .None
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.