Why I couldn't use UIPageViewController as initial ViewController on story board?

Hi! I am trying to learn about allowing display information in pages by observing the out-of-box Page-Based App application template. I found that in this template, a UIPageViewController object is handled programmatically:

-- created in viewDidLoad() function of initial UIViewController

-- added to the sub views of the initial UIViewController


I tried to simplify this by directly drag-n-drop a UIPageViewController on to storyboard, and set it as the initial UIViewController. However, when I run the application I found that it cannot even reach the break point I set in the viewDidLoad() function of theUIPageViewController, and the whole app does not display anything other than black screen on my phone.


Why using UIPageViewController as initial view controller does not work? I think there must be a reason, otherwise the out-of-box template in XCode should have avoid the complexity of an additional view controller.


Thank you!

Accepted Reply

I ended up following the Page-Based app template: initialize a UIPageViewController by code inside UIViewController.

Replies

I ended up following the Page-Based app template: initialize a UIPageViewController by code inside UIViewController.