UIPageViewCOntrollerのデリゲートメソッドですが、スワイプして、ページが止まった瞬間に呼ばれます。
また、finishedはアニメーションが終了したタイミング(遷移しようが遷移しまいが)
completedは遷移が完了したタイミングで呼ばれます。
遷移した場合、順番としてはfinishedが先です。
func pageViewController(pageViewController: UIPageViewController, didFinishAnimating finished: Bool, previousViewControllers: [UIViewController], transitionCompleted completed: Bool) {
if completed {
let currentVC = pageViewController.viewControllers![0]
print(currentVC.getClassName())
}
}
getClassNameは拡張しています。