1.首先先要了解UIPresentationController的树形和需要实现哪些函数:
presentedViewController: 要 modal 显示的视图控制器
presentingViewController: 跳转前视图控制器
containerView() 容器视图
presentedView() 被展现控制器的视图
func presentationTransitionWillBegin() 跳转将要开始
- 这里要做的就是对于你即将显示的视图UI的绘制和逻辑的完善
- 使用containerView将你需要显示的添加到视图中
-
self.presentedViewController.transitionCoordinator?.animate(alongsideTransition: { (context) in self.blurView?.effect = UIBlurEffect.init(style: UIBlurEffect.Style.extraLight) self.dimmingView?.alpha = 1.0 }, completion: nil)<

本文介绍了如何使用UIPresentationController进行自定义转场动画,包括需要实现的关键函数,如presentationTransitionWillBegin、presentationTransitionDidEnd等,并讲解了如何扩展UIViewController以实现UIViewControllerAnimatedTransitioning协议,实现平滑的视图切换效果。
最低0.47元/天 解锁文章
787

被折叠的 条评论
为什么被折叠?



