In ios8 and earlier works:
AboutViewController * _aboutViewController = [[AboutViewController alloc] init]; _aboutViewController.modalPresentationStyle = UIModalPresentationFormSheet; if(IS_IOS8) { _aboutViewController.preferredContentSize = CGSizeMake(300, 300); } [self presentViewController:_aboutViewController animated:YES completion:nil];
In AboutViewController.m
- (void)viewWillLayoutSubviews{ [super viewWillLayoutSubviews]; if(!IS_IOS8) { self.view.superview.bounds = CGRectMake(0, 0, 300, 300); } }
IS_IOS8
#define IS_IOS8 ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8)
In iOS 8, you can also use the UIPresentationController, which gives you more settings.
pawel_d Sep 22 '14 at 7:47 2014-09-22 07:47
source share