I’m using an RECurtainViewController to transition in a new view controller. In my app delegate I set my navigation bar appearance:
[[UINavigationBar appearance] setTitleTextAttributes: @{
UITextAttributeTextColor: [UIColor colorWithRed:255.0/255.0 green:255.0/255.0 blue:255.0/255.0 alpha:1.0],
UITextAttributeTextShadowColor: [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:0.8],
UITextAttributeTextShadowOffset: [NSValue valueWithUIOffset:UIOffsetMake(0.0f, 1.0f)],
UITextAttributeFont: [UIFont fontWithName:@"Helvetica" size:20.0f]
}];
The root view controller with the navigation bar displays correctly. However, when I bring in a new view controller using:
DemoViewController *test = [[DemoViewController alloc] init];
[self curtainRevealViewController:test
transitionStyle:RECurtainTransitionHorizontal];
The UINavigationBar appearance is set back to its default. Any ideas how to make the custom appearance persist?
EDIT:
I noticed I’m also getting this Warning in the console when the DemoViewController is displayed:
Warning: Attempt to present <DemoViewController: 0x1ddaae70> on <ViewController: 0x1e892040> whose view is not in the window hierarchy!
However, it still displays the view controller.
I ended up solving this by going into the viewDidLoad method in DemoViewController and assigning the attributes to the actual navBar instance:
Not sure why I have to do this, but it appears to work.