title: Array element cannot be bridged to Objective-C
body: <p>I have this code that creates a view and applies a gradient to it.</p>
  
  <pre><code>import UIKit
  import QuartzCore
  
  
  let rect : CGRect = CGRectMake(0,0,320,100)
  
  var vista : UIView = UIView(frame: rect)
  
  let gradient : CAGradientLayer = CAGradientLayer()
  gradient.frame = vista.bounds
  
  let cor1 = UIColor.blackColor()
  let cor2 = UIColor.whiteColor()
  
  let arrayColors = [cor1.CGColor, cor2.CGColor]
  
  gradient.colors = arrayColors
  
  view.layer.insertSublayer(gradient, atIndex:0)
  </code></pre>
  
  <p>Xcode is giving me no compile error, but the code is crashing on the line</p>
  
  <pre><code>let arrayColors = [cor1.CGColor, cor2.CGColor]
  </code></pre>
  
  <p>with the message <strong>array element cannot be bridged to Objective-C</strong></p>
  
  <p>In fact I was expecting it to crash there, because I am not sure how I can create an array of CGColors on Swift. The surprise here is Xcode mentioning Objective-C. In my mind I was creating a CGColorRef in swift... </p>
  
  <p>Any clues? Why is it mentioning Objective-C and how do I solve this?</p>