键盘检测

当键盘出现时,我想在我的应用程序中运行一个方法。 是否有预定义的方法或我必须创建它? 以及如何创建它?

您可以在键盘显示时收到通知:

UIKeyboardWillShowNotification UIKeyboardDidShowNotification 

您可以像这样注册通知:

 [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillShow:) name:UIKeyboardWillShowNotification object:nil]; 

更多这里 。