Add this method to get the shadow for the change in the UITableView section. This answer is in Swift3
func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? { let shadowView = UIView() let gradient = CAGradientLayer() gradient.frame.size = CGSize(width: myTab.bounds.width, height: 15) let stopColor = UIColor.gray.cgColor let startColor = UIColor.white.cgColor gradient.colors = [stopColor, startColor] gradient.locations = [0.0,0.8] shadowView.layer.addSublayer(gradient) return shadowView }
source share