Here is viewDidLoad from the main view controller in the test project:
- (void)viewDidLoad
{ [super viewDidLoad];
UIView *containerView = [[UIView alloc] initWithFrame:CGRectMake(10, 10, 300, 300)];
[self.view addSubview:containerView];
UIView *redView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 300, 300)];
[redView setBackgroundColor:[UIColor redColor]];
[containerView addSubview:redView];
UIView *yellowView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 300, 300)];
[yellowView setBackgroundColor:[UIColor yellowColor]];
[UIView transitionWithView:containerView duration:3
options:UIViewAnimationOptionTransitionFlipFromLeft animations:^{
[redView removeFromSuperview];
[containerView addSubview:yellowView];
}
completion:NULL];
}
The yellow box just appears. There is no animation, no matter which UIViewAnimationOption I try. Why???
EDIT: I've also tried using performSelector withDelay to move the animation out of viewDidLoad and into another method. Same result - no animation.
Also tried this: [UIView transitionFromView:redView toView:yellowView duration:3 options:UIViewAnimationOptionTransitionFlipFromLeft completion:NULL];
Still, the yellow view just appears. No animation.