ios - iOS8 change UIPopoverPresentationController trait collection -
i'm deploying application on both iphone , ipad (ios7 , ios8).
i'm using storyboard size classes, have base size classes any-any fits ipad layout , compact-regular fits iphone models.
view controllers in ipad version presented custom slide in/out segue, others popovers.
while works on ios7 ipad (since xcode build different storyboards) on ios8 have problem shown in popover picks iphone interface.
present in usual way:
if (uipopoverpresentationcontroller.self) { commentvc.modalpresentationstyle = uimodalpresentationpopover; uipopoverpresentationcontroller * presentationcontroller = commentvc.popoverpresentationcontroller; presentationcontroller.sourcerect = [[(afposttimelinetableviewcell*)cell commentbutton] frame]; presentationcontroller.sourceview = cell; presentationcontroller.permittedarrowdirections = uipopoverarrowdirectionany; presentationcontroller.delegate = weakself; weakself.mypop = presentationcontroller; [weakself presentviewcontroller:commentvc animated:yes completion:null]; }
checking code i've seen presented view controller has uitraitcollection
of c-r.
there way make pick r-r?
here little sample
solution found, there property in uipresentationcontroller can set uitraitcollection used on presented -overridetraitcollection
presentationcontroller.overridetraitcollection= combinedtraits.copy;
Comments
Post a Comment