点击tableview的时候隐藏键盘

点击tableview的时候隐藏键盘


- (void)viewDidLoad {
    [super viewDidLoad];
    
    UITapGestureRecognizer *tapGes = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(hideKeyboard)];
tapGes.cancelsTouchesInView = false;
[self.tableView addGestureRecognizer:tapGes];
}

- (void)hideKeyboard
{
    [self.textfieldUsername resignFirstResponder];
}

你可能感兴趣的:(点击tableview的时候隐藏键盘)