Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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]];