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

To VC sometimes jumps on display before animating. #20

Closed
markst opened this issue Nov 30, 2015 · 3 comments
Closed

To VC sometimes jumps on display before animating. #20

markst opened this issue Nov 30, 2015 · 3 comments

Comments

@markst
Copy link
Contributor

markst commented Nov 30, 2015

Sometimes navigating back through nav stack will flash present the 'toVC' view before animating it into display, which produces a nasty jumpiness.

A resolution seems to triggering a layout before performing the seemingly necessary animation to load visible cells.

    // Move the destination in place
    toVC.view.frame = [transitionContext finalFrameForViewController:toVC];
    // And kick it aside
    toVC.view.transform = CGAffineTransformMakeTranslation(delta, 0);

    [transitionContext containerView].backgroundColor = fromVC.view.backgroundColor;

    [[transitionContext containerView] layoutIfNeeded];

    // First step is required to trigger the load of the visible cells.
    [UIView animateWithDuration:0 delay:0 options:UIViewAnimationOptionCurveEaseIn animations:^{} completion:^(BOOL finished) {
@andreamazz
Copy link
Owner

Mh, that's a pretty good idea, the "empty" animation is no longer required. Brilliant.
I just pushed the changes. 👍

@markst
Copy link
Contributor Author

markst commented Dec 3, 2015

👊🏾

@markst
Copy link
Contributor Author

markst commented Dec 3, 2015

Looks perfect now. Thanks @andreamazz

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

2 participants