I am currently learning Swift and iOS development and it is quite an interesting ride. There is so much out there that I pretty much feel like I have been thrown into the ocean. Anyways, I was learning Core Data and was trying to figure out how to have a text field be multiple lines for a "Notes" section on a To Do list application that I am using to learn. You need to use a Text View to have multiple lines. Unfortunately XCode doesn't include an easy way to change the border style!
@IBOutlet weak var taskNotes: UITextView!
I have a taskNotes text view in my storyboard which I've linked in the view controller. From here, in the viewDidLoad function, I set up the color and applied it to the text view.
First you need to create a UIColor with the settings you want. In this case I set it as close as I could to match the default gray that text fields have.
Next, I specified the text view's border width. If you do not specify it, then it will not show up! I think that 0.5 is close to the default.
Afterward, you set the border color as the UIColor that you created.
Finally, text field's have a border radius which we can change as well for the text view with cornerRadius set to 5.0.