How to add an Array of pages to a UIPageViewController in iOS 5?

前端 未结 3 542
囚心锁ツ
囚心锁ツ 2021-01-14 14:46

Does anyone know what am I missing in order to add manually my own view controllers to the UIPageViewController methods?

I currently have this and I do not know how

3条回答
  •  滥情空心
    2021-01-14 15:03

    Try this function:

    setViewControllers:direction:animated:completion:
    

    Sets the view controllers to be displayed.

    - (void)setViewControllers:(NSArray *)viewControllers direction:(UIPageViewControllerNavigationDirection)direction animated:(BOOL)animated completion:(void (^)(BOOL finished))completion
    

    Parameters

    viewControllers: The view controller or view controllers to be displayed.

    direction: The navigation direction.

    animated: A Boolean value that indicates whether the transition is to be animated.

    completion: A block to be called when the page-turn animation completes.

    The block takes the following parameters:

    finished YES if the animation finished; NO if it was skipped.

提交回复
热议问题