Search code examples
swiftwatchkitwatchos

Can't use page based navigation after using presentController to change view?


When switching from a viewcontroller to another I face this problem were I can't navigate through the next page action from the vievcontroller that I land on.

Further explanation: I have 3 views and 3 different viewcontrollers. I do the first switch from the first to the second viewcontroller through code:

    presentController(withName: "TimerController", context: s)

From the second viewcontroller I'm using the ctrl+drag method in the storyboard to do the next page action to the third controller. This worked fine before i implemented the pushController method. But doesn't seem to work now. The two little circles in the UI (indicating what view is showing) doesn't show up either.

Any thoughts on how to make this work again?


Solution

  • Found the answer to the problem. In order to do this I have to present all the controllers I want to be able to show in the next step.

    presentControllerWithNames(["controllerOne", "controllerTwo"], 
          contexts: [contextObj1, contextObj2])
    

    And now the next page segue is working again :)