add background image having rounded corner from top left and top right to the 1st uitextfield i.e. username uitextfield
add background image having rounded corner from bottom left and bottom right to the 2nd uitextfield i.e. password uitextfield
add a bordered layer (CALayer), set layer properties like, borderwidth, borderColor and frame as per your requirement and add this layer to uitextfield layer.
Embed two textfields in a
UIView
and give that view thelayer.cornerRadius
that you needGiving UIView rounded corners