每当刷UIPageViewController时调用什么函数?

时间:2017-07-28 15:10:54

标签: ios swift uipageviewcontroller uipagecontrol

每当刷UIPageView时我都需要执行另一个函数。

2 个答案:

答案 0 :(得分:2)

符合similar to Netflix并实施以下方法:

func pageViewController(UIPageViewController, willTransitionTo: [UIViewController]) {
    // called when swiping begins
}

func pageViewController(UIPageViewController, didFinishAnimating: Bool, previousViewControllers: [UIViewController], transitionCompleted: Bool) {
    // called when swiping ends
}

答案 1 :(得分:1)

查看UIPageViewControllerDelegate。您可能正在寻找pageViewController(_:didFinishAnimating:previousViewControllers:transitionCompleted:)