点击空白处退出键盘
1 -(void)touchesBegan:(nonnull NSSet<UITouch *> *)touches withEvent:(nullable UIEvent *)event{ 2 [self.view endEditing:YES]; 3 }