页面切换效果

 TwoDView *twoD  =[[TwoDView alloc]init];
    CATransition *animation = [CATransition animation];
    [animation setDuration:0.4];
    [animation setType: kCATransitionPush];
    [animation setSubtype: kCATransitionFromLeft];
    [animation setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionDefault]];
    [self.navigationController pushViewController:twoD animated:NO];
    [self.navigationController.view.layer addAnimation:animation forKey:nil];
    [twoD release];
 CATransition *animation = [CATransition animation];
    [animation setDuration:0.4];
    [animation setType: kCATransitionPush];
    [animation setSubtype: kCATransitionFromRight];
    [animation setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionDefault]];
//    [self.navigationController popViewControllerAnimated:YES];
    //[self.navigationController pushViewController:threeD animated:NO];
    [self.navigationController.view.layer addAnimation:animation forKey:nil];
    [self.navigationController popViewControllerAnimated:NO];
原文地址:https://www.cnblogs.com/jiackyan/p/3436765.html