Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS Implementing Designs for iPhone Customizing Table View Controllers Styling the Navigation Bar

UITextAttributeTextColor = deprecated in iOS 7.0

Ben Jakuben

In this lesson we used the key "UITextAttributeTextColor" to change the color of the UINavigationBar appearance to white. This prompts a warning "first deprecated in iOS 7.0."

Instead:

- (void)customizeUserInterface
{
    [[UINavigationBar appearance] setBackgroundImage:[UIImage imageNamed:@"navBarBackground"] forBarMetrics:UIBarMetricsDefault];
    [[UINavigationBar appearance] setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIColor whiteColor], NSForegroundColorAttributeName, nil]];
}

This should fix the warning. Oh and, this series is the bomb diggity.

1 Answer

Ben Jakuben
STAFF
Ben Jakuben
Treehouse Teacher

Thanks, Dustin James! I added this to the Notes on that video page.