Inside my application I use a CAGradientLayer to set the background of my cell, in this way:
retValue = [tableView dequeueReusableCellWithIdenti
Just came across it now, 3 years after. Thank you Gord for this solution. Here it is in Swift 3.0:
func drawGradientOver(container: UIView) {
let transBgColor = UIColor.clear
let black = UIColor.black
let maskLayer = CAGradientLayer()
maskLayer.opacity = 0.8
maskLayer.colors = [black.cgColor, transBgColor.cgColor, transBgColor.cgColor, black.cgColor]
// Hoizontal - commenting these two lines will make the gradient veritcal
maskLayer.startPoint = CGPoint(x: 0.0, y: 0.5)
maskLayer.endPoint = CGPoint(x: 1.0, y: 0.5)
let gradTopStart = NSNumber(value: 0.0)
let gradTopEnd = NSNumber(value: 0.4)
let gradBottomStart = NSNumber(value: 0.6)
let gradBottomEnd = NSNumber(value: 1.0)
maskLayer.locations = [gradTopStart, gradTopEnd, gradBottomStart, gradBottomEnd]
maskLayer.bounds = container.bounds
maskLayer.anchorPoint = CGPoint.zero
container.layer.addSublayer(maskLayer)
}