2016-07-06 100 views
0

我想实现视图控制器之间的视图控制器过渡的视图控制器,水平和垂直。我不想使用scrollview或UIPageviewcontroller,我只是想要水平和垂直的转换。有没有办法使用UIPanGestureRecognizer和UIViewControllerAnimatedTransitioning来做到这一点?像视图控制器之间的过渡UIScrollview

+0

除非UIPageViewController无法比拟的你的目标,你建立自己。 – childrenOurFuture

+0

有没有现成的库或代码可供参考,以便了解如何构建这种类型的过渡,尤其是使用uipangesturerecognizer? –

回答

0

你或许可以在当前视图注册一个UISwipeGesture,并呼吁:

UIView.transition(from: <current view>, to: <destination view>, duration: <#T##TimeInterval#>, options: <#T##UIViewAnimationOptions#>, completion: <#T##((Bool) -> Void)?##((Bool) -> Void)?##(Bool) -> Void#>) 
} 
相关问题