Q:

Objective C - UINavigationController in Modal View

I'm developing for iPad and I have the following problem:
I'm trying to show a modal with his own size and his own UINavigationController, I already done that, but when I present the modal with his UINavigationController, I get this:

I want the UINavigationController to fit to modal size. I leave the code of how I'm presenting the modal:
- (void)createANewEvent:(id)sender
{

    AddEditEventViewController *addEditEventViewController = [[(ScheduleViewController *)self.viewContainer storyboard] instantiateViewControllerWithIdentifier:@"AddEditEventViewControllerID"];
    addEditEventViewController.modalPresentationStyle = UIModalPresentationFormSheet;
    addEditEventViewController.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;

    UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:addEditEventViewController];

    [self.viewContainer presentViewController:navigationController animated:YES completion:nil];

}

How I resize the modal:
AddEditEventViewController.m
// Resize the view
- (void)viewWillLayoutSubviews
{
    [super viewWillLayoutSubviews];
    self.view.superview.bounds = CGRectMake(0, 0, 548, 768);
    self.view.superview.backgroundColor = [UIColor clearColor];
}

Hope you can help me!
Thanks in advance! :)

A:

A view should never modify its superview's size or position.
The problem is that you're setting modalPresentationStyle on the root view controller instead of the view controller you're presenting, navigationController.

Delete:
addEditEventViewController.modalPresentationStyle = UIModalPresentationFormSheet;
addEditEventViewController.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;

Delete the viewWillLayoutSubviews method you posted.
Add:
navigationController.modalPresentationStyle = UIModalPresentationFormSheet;
navigationController.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;

