iOS - Switch between dismiss and scroll gestures

若如初见. 提交于 2019-12-03 14:33:24

That is a custom interactive transition.

First, you need set transitioningDelegate of UIViewController

id<UIViewControllerTransitioningDelegate> transitioningDelegate;

Then implment these two method to

 //Asks your delegate for the transition animator object to use when dismissing a view controller.
 - animationControllerForDismissedController:
 //Asks your delegate for the interactive animator object to use when dismissing a view controller.
 - interactionControllerForDismissal:

When drag to top, you start the transition, you may use UIPercentDrivenInteractiveTransition to control the progress during scrolling.

You can also refer to the source code of ZFDragableModalTransition

Image of ZFDragableModalTransition

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!