Reputation:
I have a UIView and I want to add shadow for leading, trailing & bottom with corner radius. I have added the function but even of no use.
extension UIView {
func drawShadowwithCorner() {
let layer = self.layer
layer.shadowColor = UIColor.black.cgColor
layer.shadowOffset = CGSize(width: 0, height: 0.2)
layer.shadowOpacity = 0.2
layer.shadowRadius = 5
layer.cornerRadius = 12
}
}
Upvotes: 0
Views: 430
Reputation: 517
The answer of Ryan Pools here should work for you. The topic is similar.
Upvotes: 2