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

Challenge 3 Customizing Navigation Bar

My code to change the text in the navigation bar to white is as follows:

[[UINavigationBar appearance] setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIColor whiteColor], UITextAttributeTextColor, nil]];

I copied it exactly from the video, and I am following along and using XCode along the way. It works in my simulator, so I am not sure why it does not work in this challenge.

It is still annoying that the challenges do not accept dictionary literal syntax - @{}. Plus, UITextAttributeTextColor is deprecated.

Ben Jakuben

1 Answer

Nevermind, the challenge was asking to change the text color, not the title text color.

The correct code is below:

[[UINavigationBar appearance] setTintColor:[UIColor whiteColor]];