title: Apply vertical alpha gradient to UITableView
body: <p>I'm new to iOS development and am trying to learn Swift. I'd like to apply a vertical alpha gradient to a UITableView, but am having some trouble.</p>
  
  <p>Originally following <a href="https://stackoverflow.com/questions/24614691/fade-out-scrolling-uitextview-over-image/24614780#24614780">this SO post</a>, I did the following:</p>
  
  <pre><code>var gradientMaskLayer:CAGradientLayer = CAGradientLayer()
  gradientMaskLayer.frame = myTableView.bounds
  gradientMaskLayer.colors = [UIColor.clearColor().CGColor, UIColor.blackColor().CGColor]
  gradientMaskLayer.locations = [0.0, 0.05]
  myTableView.layer.mask = gradientMaskLayer
  </code></pre>
  
  <p>After getting the error <code>Array element cannot be bridged to Objective-C</code> and reading <a href="https://stackoverflow.com/questions/24113354/swift-array-element-cannot-be-bridged-to-objective-c">this SO post</a> I modified the two arrays used:</p>
  
  <pre><code>var gradientMaskLayer:CAGradientLayer = CAGradientLayer()
  var gradientMaskColors:NSArray = [UIColor.clearColor().CGColor, UIColor.blackColor().CGColor]
  var gradientMaskLocations:NSArray = [0.0, 0.05]
  gradientMaskLayer.frame = myTableView.bounds
  gradientMaskLayer.colors = gradientMaskColors
  gradientMaskLayer.locations = gradientMaskLocations
  myTableView.layer.mask = gradientMaskLayer
  </code></pre>
  
  <p>And now get the error <code>Value failed to bridge from Swift type to a Objective-C type</code></p>
  
  <p>I'm struggling to find a solution. Can any lend some assistance?</p>