- 傳送門
- 很多的時候,我們需要取消鍵盤,但是又不知道鍵盤的第一響應者,那么怎么辦呢,那么可以通過一下方法解決:
[[UIApplicationsharedApplication] sendAction:@selector(resignFirstResponder)to:nil from:nil forEvent:nil];
官方文檔有說明:
The object to receive the action message. If target is nil, the app sends the message to the first responder, from whence it progresses up the responder chain until it is handled.