Detect Focus Change for UITextField

后端 未结 4 1793
臣服心动
臣服心动 2021-02-01 02:20

I\'m trying to set the animation for the view to move up when keyboard is hiding and appearing for the text fields and I got it to work perfectly fine, but when the focus moves

4条回答
  •  北荒
    北荒 (楼主)
    2021-02-01 02:40

    Use the UITextField delegate methods .. its better on your case than the keyboard methods .. when textField got focus the - (void)textFieldDidBeginEditing:(UITextField *)textField; will be fired .. and when it lost focus - (void)textFieldDidEndEditing:(UITextField *)textField; will be fired.

提交回复
热议问题