Here today we will ask about some tricky to drop shadow to view with corner radius , what if I just want to create a view with top/bottom rounded corners and drop shadow? How can I do it in Swift?
Any help would be greatly appreciated.
Here today we will ask about some tricky to drop shadow to view with corner radius , what if I just want to create a view with top/bottom rounded corners and drop shadow? How can I do it in Swift?
Any help would be greatly appreciated.
You can do this without too much code:
let circleView = UIView(frame: CGRect(x: 0, y: 0, width: 100, height: 100))
circleView.backgroundColor = .darkGray
circleView.layer.cornerRadius = 50
circleView.layer.shadowColor = UIColor.green.cgColor
circleView.layer.shadowRadius = 10
circleView.layer.shadowOpacity = 1
Result: