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
From the course: iOS 17 Development Essential Training
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…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
Choosing between SwiftUI and storyboards2m 15s
-
(Locked)
Drag and drop user interface creation with storyboards4m 12s
-
(Locked)
Change a label's text at runtime4m 43s
-
(Locked)
Handling a button press2m 32s
-
(Locked)
Using text gathered from text fields4m 21s
-
(Locked)
Showing the software keyboard2m 2s
-
(Locked)
Dismissing the software keyboard2m 41s
-
(Locked)
Troubleshoot common UI problems5m 26s
-
(Locked)
Working with pins4m 25s
-
(Locked)
Troubleshooting pins5m 13s
-
(Locked)
Challenge: Storyboards46s
-
(Locked)
Solution: Storyboards3m 29s
-
-
-
-
-