Color with Alpha component
suggest changecolorWithAlphaComponent (withAlphaComponent in Swift 3) returns a new UIColor with the given opacity. It does not change the original color.
Swift
let colorWithAlpha = UIColor.redColor().colorWithAlphaComponent(0.1)
Swift 3
let colorWithAlpha = UIColor.red.withAlphaComponent(0.1)
Objective-C
UIColor * colorWithAlpha = [[UIColor redColor] colorWithAlphaComponent:0.1];
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents