I have a view controller that displays the views of 2 submatrix controllers in a given area of ββits view. 2nd view controllers are FlopVC and FipVC.
I want to animate the transition from one subtitle to another. The code I'm using is:
-(IBAction)flip:(id)sender{ UIViewController *newVC = nil; if (self.isFlip) { newVC = [[FlopVC alloc] initWithNibName:nil bundle:nil]; }else{ newVC = [[FipVC alloc] initWithNibName:nil bundle:nil]; } newVC.view.frame = CGRectMake(120, 20, 240, 260); [self.view addSubview:newVC.view]; [UIView transitionFromView:self.currentVC.view toView:newVC.view duration:0.9 options:UIViewAnimationTransitionFlipFromLeft completion:^(BOOL finished) { self.currentVC = newVC; self.isFlip = ! self.isFlip; }]; }
Submenus are replaced, but without animation. What am I doing wrong?
PS the full project is here .
cfischer
source share