In a watch app how do you change page programmatically?
I've got 3 WKInterfaceControllers in a page based app and I want to change from one page to another when a user presses a table view cell.
I can present a view controller modally fine but when I try to push the view controller or hook the segue up to the cell controller, nothing happens.
You won't be able to push an interface controller since you're building a page-based app. The only option that you have is to use the WKInterfaceController
becomeCurrentPage method on the interface controller you want to switch to. It needs to be one of the three interface controllers already loaded into the page set.
Since you don't actually have a reference to the interface controller that you need to switch to from the table interface controller, you'll need to use a system such as NSNotificationCenter
to send a notification to the interface controller that you need to becomeCurrentPage
.
This should allow you to switch from one interface controller to another when tapping on a table row.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With