Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way of disabling a WKInterfaceMenu?

I have a WKInterfaceMenu added to the storyboard which is working great. However, once used, I don't want the menu to appear for a second time.

Is there a way of preventing the menu from appearing?

like image 459
svarrall Avatar asked Dec 20 '22 06:12

svarrall


1 Answers

You can definitely do this, but you need to do things a bit differently.

First off, don't set up the context menu in the storyboard. Instead, set up all the menu items programmatically. You can add and remove menu items using the addMenuItemWithImageNamed and clearAllMenuItems methods on your WKInterfaceController instance.

You want to set up all your menu items initially, then remove them in all your callback methods for each menu item. That way, they'll be there at first, and will be removed once you select one of them.

like image 76
cnoon Avatar answered Jan 28 '23 07:01

cnoon