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:
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?
Solution 1:
Use self.view.tintColor
from a view controller, or self.tintColor
from a UIView
subclass.
Solution 2:
It appears to be [UIColor colorWithRed:0.0 green:122.0/255.0 blue:1.0 alpha:1.0]
.