两个ViewController之间跳转的动画效果
进入SecondeViewController:
SecondViewCotroller *secondViewController = [[SecondViewCotroller alloc] init];
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationCurve:UIViewAnimationCurveEaseOut];
[UIView setAnimationDuration:1.0f];
[self.navigationController pushViewController:secondViewController animated:YES];
[UIView commitAnimations];
返回到FirstViewController:
CATransition *animation = [CATransition animation];
animation.duration = 1.0f;
//slow at beginning and end
animation.timingFunction = UIViewAnimationCurveEaseInOut;
animation.type = @"cube";
//从右向左
[animation setSubtype:kCATransitionFromRight];
[self.navigationController.view.layer addAnimation:animation forKey:@"animation"];
[self.navigationController popViewControllerAnimated:YES];