2016-07-06 79 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#>) 
} 
相關問題