In the last section, we modified our interface controller class so that it can store information within our NSUserDefaults
class and display the chosen shopping list product information within the Apple Watch glance interface controller.
In this section, we need to create the necessary code that will be responsible for retrieving information stored within our standardUserDefaults
repository database and display the chosen shopping list product item within our glance. Perform the following steps:
Open the
GlanceInterfaceController.swift
file located within the ShoppingList WatchKit Extension group in the project navigation window.Next, locate the
willActivate
method and enter the following code snippet:override func willActivate() { // This method is called when watch view controller // is about to be visible to user super.willActivate() let userDefaults = NSUserDefaults.standardUserDefaults() ...