I have this code that creates a view and applies a gradient to it.
import UIKit
import QuartzCore
let rect : CGRect = CGRectMake(0,0,320,100)
var vista :
I found that I could fix the problem by explicitly using CGColorRef rather than CGColor for my colours, e.g.:
var bottomColour:CGColorRef = UIColor.redColor().CGColor
var topColour:CGColorRef = UIColor(red: 255.0/255.0, green: 123.0/255.0, blue: 37.0/255.0, alpha: 1.0).CGColor
gradientLayer.colors = [bottomColour, topColour]
...worked fine, without any NSArray or AnyObject casting. If I take out the explicit CGColorRef in the type declarations for the colours, I get the "array element cannot be bridged to Objective-C" error.