Joel H. Joel H. - 7 days ago 5x
iOS Question

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

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?


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