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 tin
From iOS 7 there is an API and you can get (and set) the tint color with:
self.view.tintColor
Or if you need the CGColor:
self.view.tintColor.CGColor
In many cases what you need is just
[self tintColor]
// or if in a ViewController
[self.view tintColor]
or for swift
self.tintColor
// or if in a ViewController
self.view.tintColor
Adding a category to UIColor the following way will make it available to you anytime you need it or even change its definition accross your code:
@interface UIColor (iOS7Colors)
+ (instancetype)iOS7blueColor;
@end
@implementation UIColor (SpecialColors)
+ (instancetype)iOS7blueColor;
{
return [UIColor colorWithRed:0.0f green:0.22f blue:122.0/255.0 alpha:1.0f];
}
Once you import the Category in your code you can call the color by using:
UIColor *myBlueColor = [UIColor iOSblueColor];