iOS controller从底部push动画 类似模态弹出

项目需求中需要用到这种效果,正好记录一下
push:

            EleeController *createNewCtrl = [[EleeController alloc]init];
            createNewCtrl.isFromEdit = YES;
            CATransition *transition = [CATransition animation];
            transition.duration = 0.35f;
            transition.type = kCATransitionMoveIn;
            transition.subtype = kCATransitionFromTop;
            [self.navigationController.view.layer addAnimation:transition forKey:kCATransition];
            [self.navigationController pushViewController:createNewCtrl animated:NO];

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 controller从底部push动画 类似模态弹出)