I want to achieve a shadow on UITextField with round corners like below image:
My Code as below:
override func viewDidLoad() {
super.viewDidLoad()
textField.layer.cornerRadius = textField.frame.size.height / 2
textField.layer.borderWidth = 1.0
textField.layer.borderColor = UIColor(white: 0.5, alpha: 0.3).cgColor
textField.layer.shadowOpacity = 1
textField.layer.shadowRadius = 4.0
textField.layer.shadowColor = UIColor.black.cgColor
}
but, I think something is missing...
thanks in advance!




