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

how do you do this (build a diary app)

Create a local variable called appearance and assign it the appearance proxy of a UINavigationBar.

3 Answers

Stone Preston
Stone Preston
42,016 Points

you need to call the appearance method on the UINavigationBar class and assign that to a variable.

UINavigationBar *appearance = [UINavigationBar appearance];

this is covered at 1:45 of this video

for more information on the UIAppearance protocol see the documentation

Thanks that helped but i need help on the 2nd step to i put in this:

navigationBarAppearance.barTintColor = [UIColor colorWithWhite];

what am i doing wrong?

Stone Preston
Stone Preston
42,016 Points

The method is [UIColor whiteColor]

james rochabrun
PLUS
james rochabrun
Courses Plus Student 22,726 Points

and also...if you name the variable appearance you should...

appearance.tintColor = [UIColor whiteColor];