I am trying to put two UITextFields
with Swift
together similar to this question: UITextField Set Border.
So the result should be one UITextField
above the other and they will collapse on the border-bottom of the first one.
I am following the code that is on the question related:
tfUser.layer.borderWidth = 1
tfUser.layer.borderColor = UIColor(red: 69/255, green: 106/255, blue: 153/255, alpha: 1).CGColor
tfUser.layer.cornerRadius = 5
tfUser.clipsToBounds = true; //I am not able to equal this property to 'YES' so I put 'true'. Looking on the documentation I could see that it only accepts a boolean value.
tfPassword.layer.borderWidth = 2
tfPassword.layer.borderColor = UIColor(red: 69/255, green: 106/255, blue: 153/255, alpha: 1).CGColor
tfPassword.layer.cornerRadius = 5
tfPassword.clipsToBounds = true; //I am not able to equal this property to 'YES' so I put 'true'. Looking on the documentation I could see that it only accepts a boolean value.
I also have tried with the accepted answer but it does not recognize that property (I tried with borderStyle
but it also does not work as I cannot set it to UITextBorderStyleNone
).
The result I am getting right now is:
Am I missing something? What can I do to put them together?
Thanks in advance!