You need to send the -resignFirstResponder message to an instance of any user interface element that currently has the status of the first responder. Therefore, if your class has the firstNameTextField property corresponding to the UITextField instance, you need to send a message to this object.
[self.firstNameTextField resignFirstResponder];
source share