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.