Get user swiping direction in UIPageViewController

后端 未结 5 2067
长发绾君心
长发绾君心 2020-12-06 11:20

These two methods viewControllerBeforeViewController and viewControllerAfterViewController of the UIPageViewControllerDataSource don\'

5条回答
  •  情书的邮戳
    2020-12-06 11:48

    There is no way to determine whether the user swiped forward or backward.

    You need to use these two methods to provide the views before and after:

    pageViewController:viewControllerBeforeViewController:

    pageViewController:viewControllerAfterViewController:

    You can keep track of an index by adding a property to the viewControllers and then you can compare the pageIndexes.

提交回复
热议问题