This question has come up before but the accepted solutions don't seem to fix my problem which is why I'm hoping another set of eyes will catch what I'm doing wrong. I'm trying to present a 2nd navigation controller where the background is dark and semi-transparent for an iPhone app so the user can see the contents of the prior view controller. Here's the code:
-(void)viewDidLoad
{
[super viewDidLoad];
RootViewController *rvc = [[UIStoryboard storyboardWithName:@"RootView" bundle:nil] instantiateViewControllerWithIdentifier:@"RootViewRVC"];
self.nvc = [[UINavigationController alloc] initWithRootViewController:rvc];
self.nvc.modalPresentationStyle = UIModalPresentationOverCurrentContext;
[self presentViewController:self.nvc animated:YES completion:nil];
}
The above code yields this:
The app is currently using a storyboard for the navigation controller and rootviewcontroller and displays what I'm trying to achieve:
The TableViewController is a property associated with the rootviewcontroller (the code uses the same storyboard) in both images. From the navigation controller storyboard, the attributes inspector in Xcode 8 has "Presentation" set to "Over Current Context" (while "Over Full Screen" also works) which seems to do the trick, but I prefer to do this programatically so no solutions using storyboards please.
modalPresentationStyle
toOverCurrentContext
which I'm doing prior to pushing the navigation controller. Tried setting definePresentationContext but all it does is shift the navbar of the 2nd navigation controller below the original; doesn't fix the transparent problem that I can't resolve. – Vee