title: How to insert a sublayer in swift?
body: <p>I am creating a view and adding a gradient layer to it.</p>
  
  <p>I have this:</p>
  
  <pre><code>import UIKit
  import QuartzCore
  
  
  let rect : CGRect = CGRectMake(0,0,320,100)
  
  var vista : UIView = init(frame: rect)
  
  let gradient : CAGradientLayer = CAGradientLayer()
  gradient.frame = vista.bounds
  
  let cor1 = UIColor.blackColor().CGColor
  let cor2 = UIColor.whiteColor().CGColor
  
  let arrayColors = [cor1, cor2]
  
  gradient.colors = arrayColors
  </code></pre>
  
  <p>now I have to do this</p>
  
  <pre><code>[view.layer insertSublayer:gradient atIndex:0];
  </code></pre>
  
  <p>How do I do that in swift?</p>