UI7Kit
UI7Kit copied to clipboard
UINavigationBar titleTextAttributes ignored in modally presented view controllers when set via UIAppearance proxy
// Assume [UI7Kit patchIfNeeded] called in main.m before NSApplicationMain
[[UINavigationBar appearance] setTitleTextAttributes:@{ UITextAttributeTextColor : [UIColor blueColor] }];
// self.navigationController's view controllers all have correct text color.
UIViewController *vc = [[UIViewController alloc] init];
vc.title = @"Test";
UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:vc];
[self.navigationController presentViewController:navController animated:YES completion:nil];
// navController's view controllers do not have correct text color.
Add a search bar to the modally presented view controller and you get another issue. The search bar doesn't patch properly.
Another issue. If you do the following:
[UI7Kit excludeClassNamesFromAutopatch:@[@"UI7NavigationBar"]];
[UI7Kit patchIfNeeded];
Then an initial navigation view controller does not have its navigation bar patched, but any subsequently modally presented navigation view controller does have its navigation bar patched.
This may be an issue only in a modal view controller presented on an existing modal view controller.
This appears to be an issue with custom UINavigationController subclasses only.