From the course: iOS 17 Development Essential Training

Unlock this course with a free trial

Join today to access over 24,000 courses taught by industry experts.

Using text gathered from text fields

Using text gathered from text fields

- [Instructor] Now let's look at reading text from a text field. To do that, I'm going to change around my user interface just a little bit and drag this label below the button using the guides. And then I'm going to drag out a text field from the library. Remember, you can access the library using the plus button in the toolbar. And here, instead of scrolling through the existing objects, you can type in the field at the top and filter for anything you want. So if I type text, then I should see a text field in there that I could click and drag out into my user interface. So I'll do it just like that and now we have a text field. And what we're going to do is accept user input in the text field. Then when you hit the button, it will say hello and then the name of the user that was typed into this text field. From here, we need to connect the text field to code. Now you can do this one of two ways. This can be an…

Contents