In previous versions of swift, you would get white as UIColor.whiteColor()
However, in Swift 3 you will get white without initializers, for example: UIColor.white
How would I write the same function without using initializers, how UIColor.custom?
extension UIColor {
func custom() {
return UIColor(white: 0.5, alpha: 1)
}
}
source
share