Create a custom touch gesture to hide the keyboard:
- (void)viewDidLoad { [super viewDidLoad]; UITapGestureRecognizer *tapGestureRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(keyboardHide:)]; //Set to NO to indicate that the current control will propagate to other controls after the response, the default is YES. tapGestureRecognizer.cancelsTouchesInView = NO; //Add touch event to current view [self.view addGestureRecognizer:tapGestureRecognizer]; } -(void)keyboardHide:(UITapGestureRecognizer*)tap{ [textFiled resignFirstResponder]; }