I have this problem where formsheet in ios 8 is taking the constraints set for "compact - width regular -height" (that is all iPhones constraints) instead of "any- any" or "regular -width regular -height". I have two different design for iPhone and iPad since the formsheet is consuming iPhones constraint iam not able to achieve the same. Any help on this would be aprreciatd
Another solution is to use vc.presentationController.overrideTraitCollection
// in landscape mode, we want the horizontal traits to be the same as the main screen
if ( UIScreen.mainScreen.traitCollection.horizontalSizeClass == UIUserInterfaceSizeClassRegular){
//if you use UIModalPresentationFormSheet, the traits horizontal will be compact , even on iPad, so we have tell the presentationcontroller to force the horizontaltraits to regular
vc.modalPresentationStyle=UIModalPresentationFormSheet;
vc.presentationController.overrideTraitCollection = [UITraitCollection traitCollectionWithHorizontalSizeClass:UIUserInterfaceSizeClassRegular ];
[_rootViewController presentViewController:vc animated:true completion:^{}];
}
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