AddOrEditViewController *addOrEdit = [[AddOrEditViewController alloc] init];
CATransition *transition = [CATransition animation];
transition.duration = 1.0f;//动画时间
transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionDefault];//设置动画的“时机”效果。就是动画自身的“节奏”:比如:开始快,结束时变慢;开始慢,结束时变快;匀速;等,在动画过程中的“时机”效果
transition.type = @"rippleEffect";//@"cube" @"moveIn" @"reveal" @"fade"(default) @"pageCurl" @"pageUnCurl" @"suckEffect" @"rippleEffect" @"oglFlip"
/*pageCurl 向上翻一页
pageUnCurl 向下翻一页
rippleEffect 滴水效果
suckEffect 收缩效果,如一块布被抽走
cube 立方体效果
oglFlip 上下翻转效果*/
transition.subtype = kCATransitionFromLeft;//动画方向
transition.delegate = self;//这个代理不设置 会循环引用
[self.navigationController.view.layer addAnimation:transition forKey:nil];
[self.navigationController pushViewController:addOrEdit animated:YES];