From the course: iOS Development Tips

Unlock this course with a free trial

Join today to access over 22,600 courses taught by industry experts.

UITextViews and coordinators

UITextViews and coordinators

From the course: iOS Development Tips

UITextViews and coordinators

- [Instructor] One of my biggest gripes of SwiftUI is the lack of a UITextView equivalent. There's a text field, but it's really cranky. It's only one line, and as you can see here in the exercise files, which you can download. If you go ahead and run this, first of all, it's not working at all. You can see it's supposed to have a place marker, Comments in TextField, and it's missing here in this box. And even if I click it I can't get the first responder. Now I've also added a UITextView to this, and you can use the UITextView in SwiftUI with a UIView representable object to display this object. Now I'm going to cover how to do that in detail in the SwiftUI essential training, but if you stop the app or scroll on down here, you'll see how to set this up. Pretty much what you're going to do is you're going to create a struct for TextView called UIViewRepresentable, and inside of this you're going to put a binding of String…

Contents