Pietro Messineo Pietro Messineo - 6 months ago 20
Swift Question

Use menu item for open another interface controller

I'm trying to add the possibility to use Force Touch for opening another Interface Controller on my Apple Watch. Is it possible to use the Menu object through the Menu Item for launching another Interface Controller? And if yes, how can I?
Thank you!

Answer Source

Yes, it is possible. You need to create an IBAction for your Menu Item and call the desired navigation function inside that IBAction. I will show you code for using presentController, but you can use any other available navigation function from WatchKit.

@IBAction func presentOtherInterfaceController() {
    self.presentController(withName: "MyOtherInterfaceController", context: nil)
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download