UIPageViewController NSInternalInconsistencyException

后端 未结 5 1917
佛祖请我去吃肉
佛祖请我去吃肉 2021-02-20 17:51

I\'m developing a simple UIPageViewController that has two pages. Each page is loaded from a different ViewController with their specific xib

5条回答
  •  你的背包
    2021-02-20 18:16

    I was having one 'UIPageViewController' in Storyboard and from one of the pages, I was trying to present new 'UINavigationController' with attached 'Rootviewcontroller' which was in separate xib.

    When I removed xib and put this view controller as stand alone in storyboard it worked like a charm.

    So I think the catch is that if both the container view are in same storyboard then it is not giving any exception or error.

    let listView = String(describing: ListViewController.self)
    let listViewController = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: listView)
    let navigationController = UINavigationController(rootViewController: listViewController)
    self.present(navigationController, animated: true, completion: nil)
    

提交回复
热议问题