Establishing glance interface controller connections
In the previous sections, we successfully created our GlanceInterfaceController
class that will be used to display the selected shopping list item within our glance. Our next step is to create Outlets for our shopping list item name as well as the associated price information:
Open the Assistant Editor window by going to Navigate | Open in Assistant Editor or pressing Option + Command + ,.
Ensure that the
GlanceInterfaceController.swift
file is displayed within the Assistant Editor window, as shown in the following screenshot:Next, select the Label (
WKInterfaceLabel
) control, then hold down the Control key, and drag it into theGlanceInterfaceController.swift
file within the body ofclass GlanceInterfaceController: WKInterfaceController
class body.Select Outlet from the Connection drop-down menu for the type of connection to create and enter
titleLabel
for the name of the Outlet property to create.Next, select Weak from the Storage drop...