Adding a menu to our Shopping List application – WatchKit
In this section, you will learn how to add a menu to our existing Shopping List application from the previous chapter. Perform the following steps:
Select the ShoppingList.xcodeproj file from the
Chapter 06
folder in the accompanying code bundle, as shown in the following screenshot:Next, ensure that the
ShoppingList
Xcode project file is open within the Xcode development IDE.Now, select the Interface.storyboard file located within the ShoppingList WatchKit Extension group in the project navigation window.
Then, from Object Library, drag a
WKInterfaceMenu
control to the watch area canvas.Next, select the Menu (
WKInterfaceMenu
) control that we added previously.Then, from the Attributes Inspector section in the Menu section, change the Items property to 4.
Now, select the first Menu Item (
WKInterfaceMenuItem
) object under Menu on the left-hand side and modify the Title property to Clear List and the Image property to Trash.Repeat the same...