我确实有 DetailViewController,其中包含数组中单个对象的信息。 (例如,我有一系列汽车,我想在 detailViewController 上显示阵列中的一辆汽车)
通过向左/向右滑动,我想查看数组中的下一辆/上一辆汽车。
到目前为止,我只是更改了与当前汽车对象匹配的标签文本,但我希望每次滑动时都有动画。
switch swipeGesture.direction {
case UISwipeGestureRecognizerDirection.Left:
if currentIndex < events.count-1 {
currentIndex += 1
}
case UISwipeGestureRecognizerDirection.Right:
if currentIndex != 0 {
currentIndex -= 1
}
default:
break
}
那么,实现这一目标的最有效方法是什么?
最佳答案
你必须使用 UIPageViewController .
关于ios - 使用不同数据从 ViewController 到自身的动画/Segue - Swift,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34104908/