ios - Popover Doesn't Work on iPhone -
i implemented popover
in application , tested it. work fine on ipad when test on iphone, instead of showing popover
show full storyboard. please me.
here code:
@ibaction func menuisclick(sender: anyobject) { var movetonextvc:menuviewcontroller movetonextvc = self.storyboard?.instantiateviewcontrollerwithidentifier("menuviewcontroller") as! menuviewcontroller movetonextvc.modalpresentationstyle = .popover movetonextvc.preferredcontentsize = cgsizemake(200, 200) if let popovercontroller = movetonextvc.popoverpresentationcontroller { popovercontroller.sourceview = sender as! uiview popovercontroller.sourcerect = cgrect(x: 0, y: 0, width: 85, height: 30) popovercontroller.permittedarrowdirections = .any popovercontroller.delegate = self } presentviewcontroller(movetonextvc, animated: true, completion: nil) } func adaptivepresentationstyleforpresentationcontroller(controller: uipresentationcontroller!, traitcollection: uitraitcollection!) -> uimodalpresentationstyle { return .none }
edit: popover not work on iphone when refer ethanstrider/ios-projects work fine. how?
uipopovercontroller's available on ipad.
popover controllers use exclusively on ipad devices. attempting create 1 on other devices results in exception.
though ios 8+, no longer crashes, executed full screen modal presentation..
Comments
Post a Comment