Search code examples
swiftwatchkit

Dynamic number of pages in Watchkit Page Navigation


Is there any way dynamically create pages in a page-based navigation? In every example I read, the pages were created as Interface Controllers and linked in the Storyboard.


Solution

  • Here is the way to do it

    WKInterfaceController.reloadRootControllersWithNames(["pageController", "pageController"], contexts: ["pageController", "pageController"])