Ios – rounded corner to UITextField Xcode

iosswiftuser-experienceuser-interfacexcode

I have two textfield (username & password) and want to make top rounded corner for username and bottom rounded corner for password as per attachment.

enter image description here

Best Solution

Just create a UIView.

Put your two text fields in the UIView. Remove the border style of UITextField.

yourView.layer.cornerRadius = 10.0
yourView.clipsToBounds = true