headerView.layer.shadowOpacity = 1
headerView.layer.shadowOffset = CGSize(width: 0, height: 1)
headerView.layer.shadowRadius = 1
let layer : CAGradientLayer
layer.colors = [fromColor.cgColor, toColor.cgColor]
layer.shadowRadius = 1
layer.startPoint = CGPoint(x: 0.5, y: 1.0)
layer.endPoint = CGPoint(x: 0.5, y: 0.0)
layer.frame = CGRect(x: 0.0, y: headerView.frame.height - shadowRadius, width: headerView.frame.width, height: shadowRadius)
headerView.layer.addSublayer(layer)
I ve tried to give bottom drop shadow to headerView but none of them worked, is there anything should I know ? I ve tried these code blocks: