0

I have a UITextField inside of a UIView. I am using spring animations and it's working great until I try to select text inside of the UITextField. It then makes the UIView return to its original position.

-(void)keyboardOnScreen:(NSNotification *)notification
{
NSDictionary *info  = notification.userInfo;
NSValue      *value = info[UIKeyboardFrameEndUserInfoKey];
CGRect rawFrame      = [value CGRectValue];
CGRect keyboardFrame = [self.view convertRect:rawFrame fromView:nil];
CGSize screenSize = [[UIScreen mainScreen] bounds].size;

springEntryBox = [POPSpringAnimation animationWithPropertyNamed:kPOPLayerPositionY];
NSLog(@"%f", keyboardFrame.size.height);
springEntryBox.toValue = @((screenSize.height - keyboardFrame.size.height) - entryBox.frame.size.height / 2);
springEntryBox.springBounciness = 10.f;
springEntryBox.springSpeed = 5;
[entryBox.layer pop_addAnimation:springEntryBox forKey:@"springAnimShow"];
}

Note: The method keyboardOnScreen is called when notification center has event UIKeyboardWillShowNotification.

Lucky
  • 579
  • 6
  • 24
  • is this the same problem like the missing delegate ? – Teja Nandamuri Jan 03 '16 at 02:40
  • No, I think this is something entirely different. I'm thinking there is a conflict between iOS system animations (like Keyboard popping up and selection of text) and my Facebook Pop animations. – Lucky Jan 03 '16 at 02:45

0 Answers0