Text fields are similar to labels in iOS, with the exception that they are editable by a user. This video shows how to capture and use data from a text field when building an iOS app.
- [Instructor] So let's say we wanted to capture…some user input from a text field…and put that inside of our label.…Let's head over to our storyboard…and create a text field.…We can do that by clicking the library button…and searching for text field,…and just click and drag that right onto the screen.…So let's just reorganize this a little bit.…I'll put the label below the button.…The text field above.…I'll make it nice and wide.…And I'll change the button to Say Hello.…
Remember I'm double clicking to go into text editing mode…and then pressing Return to commit the changes.…And then what we'll do is we'll put our name in the label,…hit the button,…then we'll update the label to say hello…and then whatever they put inside of here.…So the label might be something to enter your name,…and this is going to capture the name…and present that through the label.…So again we'll need to connect this to our code,…and just for fun,…let's look at a different way…to connect our text field to our code.…
So I'll head over to ViewController.swift,…
- Installing and using Xcode
- Working with storyboards
- Working with UI objects and events
- Resizing objects and layouts dynamically
- Coding UI objects such as buttons
- Loading and displaying data in table views
- Testing your iOS app
Skill Level Beginner
1. Xcode Fundamentals
2. Core Skills
3. Responsive UI Design
4. Coding UI Objects
5. Table Views
6. App Flow and Testing
Next steps1m 8s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.