Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

while a UITextView is editing, click to a UITextField, would make a dead loop #61

Open
aelam opened this issue Apr 5, 2014 · 1 comment

Comments

@aelam
Copy link

aelam commented Apr 5, 2014

No description provided.

@aelam
Copy link
Author

aelam commented Apr 5, 2014

I have reviewed the code
the problem might be here, see below

- (void)reAssignFirstResponder
  {
   // Find first responder
   UIView *inputView = [self findFirstResponder];
   if (inputView != nil) {
       // Re assign the focus
     //        [inputView resignFirstResponder];   // <-- the two lines cause a dead loop 
  // after commented the above line, it works well on iOS7, iOS5 (I have no other devices)
          [inputView becomeFirstResponder];
   }

}

and I did a little improvement, in -inputKeyboardWillChangeFrame, - (void)inputKeyboardWillShow:,-inputKeyboardWillHide: we don't need animation if keyboard frame not change, see below

    - (void)inputKeyboardWillShow:(NSNotification *)notification
   {
       CGRect keyboardEndFrameWindow = [notification.userInfo[UIKeyboardFrameEndUserInfoKey] CGRectValue];

   CGRect keyboardBeginFrameWindow = [notification.userInfo[UIKeyboardFrameBeginUserInfoKey] CGRectValue];
   // if the frame of keyboard doesn't change, we just skip the animation
   if (CGRectEqualToRect(keyboardBeginFrameWindow, keyboardEndFrameWindow)) {
       self.keyboardActiveView.hidden = NO;
       if (self.panning && !self.keyboardPanRecognizer) {
           [self setupGestureRecognizer];
       }
       return;
   }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant