2

I'm building an iOS app that allows the user to select a color scheme. The app has basically one accent color that I would like to change, however it is used throughout the app on labels, backgrounds, buttons, things in tables, etc...

What would be the best way to get around lengthy code?

My first option was to just hand code in every UI element (the long way). Is their an easier way to go?

I saw this question but the answer doesn't seem applicable to my situation: Can I tag a UIColor?

Community
  • 1
  • 1
keji
  • 5,947
  • 3
  • 31
  • 47

1 Answers1

0

Sounds like you want to look at UIAppearance:

You can customize the appearance of instances of a class by sending appearance modification messages to the class’s appearance proxy.

For example, to modify the bar background tint color for all instances of UINavigationBar:

[[UINavigationBar appearance] setBarTintColor:myNavBarBackgroundColor];

Some commentary here

Community
  • 1
  • 1
Bryan
  • 11,398
  • 3
  • 53
  • 78