如何实现用户触摸屏幕就隐藏弹出的键盘功能
1. 主要是响应 UIResponder 类的
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event;
或者
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event;
因为我们的controller一般从 UIViewController 继承,而 UIViewController 从UIResponder继承,所以 Controller 可以直接使用这两个
函数。
下面是代码: