2
votes

I have a view controller that I am presenting modally over another view controller, and the background view for the top VC has a blur effect. When I am using the following code, the top view controller appears over the bottom view controller, but the top controller is hidden behind the navigation bar:

MOSettingsViewController *settingsViewController = [[MOSettingsViewController alloc]init];
settingsViewController.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
settingsViewController.modalPresentationStyle = UIModalPresentationOverCurrentContext;
self.providesPresentationContextTransitionStyle = YES;
self.definesPresentationContext = YES;
[self presentViewController:settingsViewController animated:YES completion:nil];

When I remove the line settingsViewController.modalPresentationStyle..., the new view controller appears over the navigation bar, but the presenting view controller turns black, and ruins the blur effect.

How can I get a mixture of these two presentations, where the presenting view controller stays visible and the navigation bar is under the presented view controller?

1

1 Answers

5
votes

Instead of using UIModalPresentationOverCurrentContext, I needed to use UIModalPresentationOverFullScreen.