First responders are the objects that are first to receive events in iOS app development. This video explains how first responders work and how to use them to handle keyboard events in your apps.
- [Narrator] When you're developing an application in iOS,…you often want to make sure you can dismiss the keyboard…when you're done using a text field.…To do that, you need to use…something called first responders.…A first responder is the object that's…currently receiving events.…So when the keyboard's up,…the text field is the first responder.…In other words, when somebody types…anything in to the keyboard, that particular text field…is the object that's receiving…that information from the keyboard.…
To dismiss the keyboard, you tell…the text field to resign itself as a first responder.…Let's take a look at how that works.…Scroll down into buttonWasTapped,…go below the line of code we already wrote,…and then type textfield.resignFirstResponder.…So find that in the code.…Press return to have X code finish it for you,…and then run the application.…And you should see the keyboard go away…once you hit the button.…
So I click inside of that text field.…Type my name, hit the button,…and watch the keyboard slide down.…
- 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.