Q&A
Ask and answer questions to make information more available to wider audiences.
Jackson Buckwalter @jacksonbuckwalter1   01, Jul 2019 12:00 AM
TextField border
Hi everyone,

I am using xcode 10 and swift 5. I want to set a border for text field.

Can please anyone help me with this problem.

Tanks
answers 1
 
Answer 1
Emma Jackson @jacksonemma7   01, Jul 2019 07:21 PM
Using XCode10 and Swift5 you can use the following code:


let borderColor : UIColor = UIColor(red: 0.85, green: 0.85, blue: 0.85, alpha: 1.0)
descriptionField.layer.borderWidth = 0.5
descriptionField.layer.borderColor = borderColor.cgColor
descriptionField.layer.cornerRadius = 5.0