Watchkit page based navigation - reloadRootPageControllers doesn't work

Viewed 507

When calling the WKInterfaceController.reloadRootPageControllers method, the navigation interface does not reload with multiple view controllers as was the case in WatchOS 4.

I've attempted this method by calling two Hosting Controllers (both SwiftUI) which to my mind ought to return two identical SwiftUI views, a Hosting Controller and WatchKit Interface Controller, and two interface controllers. None of them seem to work (although running the WatchOS 5 emulator on MacOS 10.14 is very glitchy)

WKInterfaceController.reloadRootPageControllers(withNames: ["hostingController", "hostingController"],
                                                          contexts: nil,
                                                          orientation: .vertical,
                                                          pageIndex: 0)

When performing the action using a SwiftUI button which contains the function is called, but no results appear. ie. the initial root controller remains and no white dots appear at the bottom of the screen to allow user swiping between views.

0 Answers
Related