UIView Animation won't run transition

Posted by dpelletier on Stack Overflow See other posts from Stack Overflow or by dpelletier
Published on 2010-06-11T08:21:16Z Indexed on 2010/06/11 8:22 UTC
Read the original article Hit count: 328

Filed under:
|
|
|

So, I've searched quite a bit for this and can't seem to find a solution. This code works:

CGContextRef context = UIGraphicsGetCurrentContext();
[UIView beginAnimations:nil context:context];
[UIView setAnimationDuration:5];
[c setCenter:CGPointMake(200, 200)];
[UIView commitAnimations];

This code doesn't:

CGContextRef context = UIGraphicsGetCurrentContext();
[UIView beginAnimations:nil context:context];
[UIView setAnimationBeginsFromCurrentState:YES];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:c cache:YES];
[UIView setAnimationDuration:5];
[c exchangeSubviewAtIndex:0 withSubviewAtIndex:1];
[UIView commitAnimations];

And I know the call to exchangeSubViewAtIndex is working because if I remove it from the animation block it functions as expected.

Anyone have any insight as to why this transition won't run? Something I need to import?

© Stack Overflow or respective owner

Related posts about iphone

Related posts about objective-c