This simple example, but which does not work,
I have a ViewController where internally on the NavigationConroller, then I want to add a new ViewConroller with its self-navigation controller.
In the main view, the controller:
CustomViewController *vc = [[CustomViewController alloc] init];
NewNavigationVC *nav = [[NewNavigationVC alloc] initWithRootViewController:vc];
[self presentViewController:nav animated:NO completion:nil];
Two controllers have a background color, but black. Navigation Bar I can make a clear, but not a presentation.
UPDATE:
if I change self.window.backroundColor to red, for example, this works, but fuzzy
UPDATE 2:
[self addChildViewController:vc]
[self.view addSubview:vc.view]
[vc didMoveToParentViewController:self]
and when I want dealloc vc
[vc willMoveToParentViewController:nil]
[vc.view removeFromSuperview]
[vc removeFromParentViewController]
Everything works fine without a navigation controller
source
share