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];