iOS开发,push跳转(从下往上推上来)

- (void)push

{

OneViewController *vc = [[OneViewController alloc] init];

vc.view.backgroundColor = [UIColor redColor];

CATransition* transition = [CATransition animation];

transition.duration = 0.4f;

transition.type = kCATransitionMoveIn;

transition.subtype = kCATransitionFromTop;

[self.navigationController.view.layer addAnimation:transition forKey:kCATransition];

[self.navigationController pushViewController:vc animated:NO];

}

- (void)pop

{

CATransition* transition = [CATransition animation];

transition.duration = 0.4f;

transition.type = kCATransitionReveal;

transition.subtype = kCATransitionFromBottom;

[self.navigationController.view.layer addAnimation:transition  forKey:kCATransition];

[self.navigationController popViewControllerAnimated:NO];

}

你可能感兴趣的:(iOS开发,push跳转(从下往上推上来))