【发布时间】:2020-02-11 14:39:27
【问题描述】:
我正在尝试将交互式过渡添加到我的视图控制器的模态演示中。我添加 pangesturerecognize 来检测用户的触摸并移动视图。我刚刚阅读了很多关于自定义转换的文章,并且在每篇文章中作者都在开头调用了dismiss方法:
func handleGesture(_ gestureRecognizer: UIScreenEdgePanGestureRecognizer)
switch gestureRecognizer.state {
case .began:
interactionInProgress = true
viewController.dismiss(animated: true, completion: nil)
...
}
我已尝试删除此方法,但它仍然有效。
有人可以解释为什么我们需要在处理手势开始时调用dismiss(animated: true, completion: nil) 吗?
【问题讨论】:
标签: ios transition uigesturerecognizer