UI7Kit icon indicating copy to clipboard operation
UI7Kit copied to clipboard

UINavigationBar titleTextAttributes ignored in modally presented view controllers when set via UIAppearance proxy

Open postmechanical opened this issue 11 years ago • 4 comments

    // 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.

postmechanical avatar Oct 15 '13 21:10 postmechanical

Add a search bar to the modally presented view controller and you get another issue. The search bar doesn't patch properly.

ios simulator screen shot oct 15 2013 3 41 37 pm

postmechanical avatar Oct 15 '13 21:10 postmechanical

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.

postmechanical avatar Oct 15 '13 21:10 postmechanical

This may be an issue only in a modal view controller presented on an existing modal view controller.

postmechanical avatar Oct 16 '13 18:10 postmechanical

This appears to be an issue with custom UINavigationController subclasses only.

postmechanical avatar Nov 25 '13 17:11 postmechanical