我确实有DetailViewController以及数组中单个对象的信息。(例如,我有一个汽车阵列,我想在detailViewController上显示阵列中的1辆汽车)
通过向左/向右滑动,我想查看阵列中的下一辆/上一辆车。
到目前为止,我只是更改了与当前汽车对象匹配的标签文本,但我希望每次滑动都具有动画效果。
switch swipeGesture.direction {
case UISwipeGestureRecognizerDirection.Left:
if currentIndex < events.count-1 {
currentIndex += 1
}
case UISwipeGestureRecognizerDirection.Right:
if currentIndex != 0 {
currentIndex -= 1
}
default:
break
}
那么,归档此目标的最有效方法是什么?
您必须使用UIPageViewController。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句