Create GradientLayer on your tableViewCell(collectionViewCell) 1. Create CAGradientLayer Instance on your tableViewCell class MyCell: UITableViewCell { let gradientLayer = CAGradientLayer() }