rounded corner to UITextField Xcode

PPShein picture PPShein · Jun 9, 2015 · Viewed 7.4k times · Source

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

Answer

Ashish Kakkad picture Ashish Kakkad · Jun 9, 2015

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