我通过这样做将键盘滑出屏幕:
-(void)methodA {
[textField resignFirstResponder];
}
当键盘隐藏时,我会听到UIKeyboardDidHideNotification
通知,这里是通知的选择器:
- (void)keyboardHidden:(NSNotification *)notification {
// What to do here?
}
现在在方法A中,我想在键盘被隐藏时得到通知,以便我可以开始执行另一项任务,我的伪代码如下所示:
-(void)methodA {
[textField resignFirstResponder];
wait until keyboardHidden = YES
if(keyboardHidden) {
// code
}
}
我怎样才能做到这一点?