watchTemplate
watchTemplate
watchTemplate Instance Property of INRelevantShortcut The template that the Siri watch face uses to display the relevant shortcut.
@NSCopying var watchTemplate: INDefaultCardTemplate? { get set }Discussion
Provide a template when you want to customize the appearance of the relevant shortcut card displayed on the Siri watch face.
The listing below sets the watch template for a relevant shortcut in the Soup Chef sample app.
let suggestedShortcut = INRelevantShortcut(shortcut: shortcut)
let localizedTitle = NSString.deferredLocalizedIntentsString(with: "ORDER_LUNCH_TITLE") as String
let template = INDefaultCardTemplate(title: localizedTitle)
// Need a different string for the subtitle because of capitalization difference.
template.subtitle = NSString.deferredLocalizedIntentsString(with: menuItem.shortcutNameKey + "_SUBTITLE") as String
template.image = INImage(named: menuItem.iconImageName)
suggestedShortcut.watchTemplate = template