init(colorLiteralRed:green:blue:
2018-08-09 本文已影响0人
一念飘过
swift 4语言编译报错:
init(colorLiteralRed:green:blue:alpha:)' is unavailable: This initializer is only meant to be used by color literals
把你写的
UIColor(colorLiteralRed: 255/255.0, green: 255/255.0, blue: 223/255.0, alpha: 1)
改为:
UIColor(displayP3Red: 255/255.0, green: 255/255.0, blue: 223/255.0, alpha: 1)
并且加上
@available(iOS 10.0, *)