1
無論何時刷一個UIPageView,我都需要執行另一個函數。只要刷一個UIPageViewController,什麼函數被調用?
無論何時刷一個UIPageView,我都需要執行另一個函數。只要刷一個UIPageViewController,什麼函數被調用?
順應UIPageViewControllerDelegate
和實現以下方法:
func pageViewController(UIPageViewController, willTransitionTo: [UIViewController]) {
// called when swiping begins
}
func pageViewController(UIPageViewController, didFinishAnimating: Bool, previousViewControllers: [UIViewController], transitionCompleted: Bool) {
// called when swiping ends
}
退房的UIPageViewControllerDelegate。您可能正在尋找pageViewController(_:didFinishAnimating:previousViewControllers:transitionCompleted:)
謝謝!這很好知道! – SwiftyJD