I am very new to swift and trying to create an extension of UIColor class as
extension UIColor{
func getCustomBlueColor() -> UIColor {
retur
With Swift 3, predefined UIColors are used accordingly:
var myColor: UIColor = .white // or .clear or whatever
Therefore, if you want something similar, such as the following...
var myColor: UIColor = .myCustomColor
...then, you would define the extension like so:
extension UIColor {
public class var myCustomColor: UIColor {
return UIColor(red: 248/255, green: 248/255, blue: 248/255, alpha: 1.0)
}
}
In fact, Apple defines white as:
public class var white: UIColor