- 回收键盘的关键语句是
[self.view endEditing:YES];
- 点击空白处调用的函数是控制器的touch begin
- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
}
- 点击空白区域回收键盘,两个方法组合
- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
[self.view endEditing:YES];
}
网友评论