How can I get the iOS 7 default blue color programmatically?

Joel H. picture Joel H. · Sep 26, 2013 · Viewed 149.5k times · Source

I'm creating custom elements in my app and want to match the look and feel of the new iOS. iOS 7 introduced to us a very common lighter blue color, the default color or tint for several elements, including the system button, segmented control, etc. They've made it easy to select the color using IB, as seen here:

enter image description here

However, I haven't found how to easily access the color programmatically. I checked out the UIColor documentation, and there doesn't seem to be any accessor for the blue system color in the class itself.

Here's my question: does a simple accessor exist for this color? [UIColor ?] or something like it? If not, does someone know the exact RGB values for that color?

Answer

Aaron Brager picture Aaron Brager · Sep 26, 2013

Use self.view.tintColor from a view controller, or self.tintColor from a UIView subclass.