Skip to content

Instantly share code, notes, and snippets.

@MaximAlien
Created December 21, 2015 16:00
Show Gist options
  • Save MaximAlien/5b0ec215afaf434024cb to your computer and use it in GitHub Desktop.
Save MaximAlien/5b0ec215afaf434024cb to your computer and use it in GitHub Desktop.
[iOS] Change corner radius and size of the UIViewController presented modally
// For UIViewController inside UINavigationController
- (void)viewWillLayoutSubviews
{
[super viewWillLayoutSubviews];
self.navigationController.view.superview.bounds = CGRectMake(0, 0, 300, 300);
self.navigationController.view.superview.layer.cornerRadius = 2.0f;
}
// Usual presentation
- (void)viewWillLayoutSubviews
{
[super viewWillLayoutSubviews];
self.view.superview.bounds = CGRectMake(0, 0, 300, 300);
self.view.superview.layer.cornerRadius = 2.0f;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment