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 trialAlejandro Machado
16,091 PointsNot 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
Courses Plus Student 10,224 PointsYou 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
Alejandro Machado
16,091 PointsThat throws a compiler error. Interesting, I think that line does the same as what I posted.
Alejandro Machado
16,091 PointsI mean it throws a compiler error in Treehouse's challenge website, on Xcode it works just fine.
Guillaume Maka
Courses Plus Student 10,224 PointsWell I tried it on treehouse and like you it throw a compiler error,
Guillaume Maka
Courses Plus Student 10,224 Points@Alejandro Machado see the edited answer
Alejandro Machado
16,091 PointsGreat, this works. Thanks! I think Treehouse should accept the other answer too, though.
Rohan A.
4,008 PointsRohan A.
4,008 PointsWait, Alejandro Machado and Guillaume Maka - please see my thread here