Now, let’s see delegation in action. You will use delegation in order to dismiss the keyboard for each of the text fields. The general idea is that you assign the controller as the delegate for the text fields. This way you will be notified when the “return” key on the keyboard is tapped.
To achieve this, you must do three things:
1. Add the UITextFieldDelegate protocol to the controller class declaration in the header file.
2. Implement UITextFieldDelegate methods in the controller implementation file.
3. Set the controller as the delegate for each UITextField instance.
After completing these three steps, the text fields will notify the controller when certain events take place—when editing begins or ends and when the ...