Pergunta

All I can seem to find in examples are using transforms or are modifying frames. Have I missed something obvious? Currently the other animations (fades) are all working fine, however the constraint stays locked in position.

A quick code snippet:

[[customViewController view] layoutIfNeeded];
[UIView animateWithDuration:2 animations:^{

    [[customViewController constraintToAnimate] setConstant:1024];
    [[customViewController view] layoutIfNeeded];

} completion:^(BOOL finished) {
    [transitionContext completeTransition:YES];
}];
Foi útil?

Solução

You need to call layoutIfNeeded on the [[customViewController view] superview]

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top