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

Alejandro Machado
Alejandro Machado
16,091 Points

Not accepting a right answer?

For part 3 of the challenge, I am adding the following line of code to the method:

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

I just tested this code on Xcode and it does indeed change the text color of the bar buttons to white, which was what was intended in the challenge.

Am I missing something? :)

Thanks!

3 Answers

Guillaume Maka
PLUS
Guillaume Maka
Courses Plus Student 10,224 Points

You need to use

// works on xcode
[UIBarButtonItem appearance].tintColor = [UIColor whiteColor]; 

// for treehouse 
[[UINavigationBar appearance] setTintColor:[UIColor whiteColor]];

My mistake most of the time we customize bar button via UINavigationBar appearance proxy

Wait, Alejandro Machado and Guillaume Maka - please see my thread here

Alejandro Machado
Alejandro Machado
16,091 Points

That throws a compiler error. Interesting, I think that line does the same as what I posted.

Alejandro Machado
Alejandro Machado
16,091 Points

I mean it throws a compiler error in Treehouse's challenge website, on Xcode it works just fine.

Guillaume Maka
Guillaume Maka
Courses Plus Student 10,224 Points

Well I tried it on treehouse and like you it throw a compiler error,

Alejandro Machado
Alejandro Machado
16,091 Points

Great, this works. Thanks! I think Treehouse should accept the other answer too, though.