On tableView\'s cells, I\'m trying to define a gradient with the following Swift code:
func tableView(tableView: UITableView!, cellForRowAtIndexPath indexPath: N
I had a similar problem, my mistake was inserting the new layer with gradient directly in the cell, try inserting the new layer to the backgroundView something like this
let gradient = CAGradientLayer()
// layer setup...
cell.backgroundView = UIView()
cell.backgroundView?.layer.insertSublayer(gradientLayer, atIndex: 0)
Hope this helps.