Tricertops/KeepLayout

Animation delay with layout

Closed this issue · 1 comments

I need to up some of my views when keyboard is showed and I need this animated. I used following code:

keyboardBounds = [self.view convertRect:keyboardBounds toView:nil];
CGFloat keyboardHeight = CGRectGetHeight(keyboardBounds);

NSNumber *duration = note.userInfo[UIKeyboardAnimationDurationUserInfoKey];
NSNumber *curve = note.userInfo[UIKeyboardAnimationCurveUserInfoKey];

UIViewAnimationOptions options = UIViewAnimationOptionBeginFromCurrentState | curve.intValue;
[self.view keepAnimatedWithDuration:duration.doubleValue delay:0 options:options layout:^{
    _bottomView.keepBottomInset.equal = KeepRequired(keyboardHeight);
} completion:^(BOOL finished) {
    // do something
}];

It works with animation but with strange delay: first keyboard animation and only after it I see view's animation. What could be a reason of this delay?

Sorry If this is not a place for such questions.

I experienced this delay too, but it’s not related to KeepLayout.