This no longer works in Xcode 8 beta 6:
let colors:CFArray = [fromColor.cgColor, toColor.cgColor]
or
let gradient:CGGradient = CGGradient(colorsSpace: CGColorSpaceCreateDeviceRGB(), colors:[fromColor.cgColor, toColor.cgColor], locations:[0.0, 1.0])!
The error is: Contextual type 'CFArray' cannot be used with array literal
What's the latest way to convert from array to CFArray?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…