How do I draw a horizontal shadow under the bottom of a view?
Currently, I'm drawing it like this
layer.shadowColor = UIColor.darkGray.cgColor
layer.shadowOpacity = 0.3
layer.masksToBounds = false
layer.shadowRadius = 2
let shadowPath = UIBezierPath()
shadowPath.move(to: CGPoint(x: 0, y: bounds.height))
shadowPath.addLine(to: CGPoint(x: bounds.width, y: bounds.height))
shadowPath.addLine(to: CGPoint(x: bounds.width, y: bounds.height + shadowHeight))
shadowPath.addLine(to: CGPoint(x: 0, y: bounds.height + shadowHeight))
shadowPath.close()
layer.shadowPath = shadowPath.cgPath
But I end up with a small vertical shadow.
I'm hoping to just cut off all the vertical shadow like this