Instance Method

getVoiceShortcut(with:completion:)

Retrieves a shortcut the user added to Siri.

Declaration

func getVoiceShortcut(with identifier: UUID, completion completionHandler: @escaping (INVoiceShortcut?, Error?) -> Void)

Parameters

identifier

The shortcut identifier.

completionHandler

The block invoked on a background thread after the system retrieves the shortcut. This block has no return value and takes the following parameters:

voiceShortcut

An instance of INVoiceShortcut representing the requested shortcut; otherwise, nil if the shortcut doesn't exist or an error occurs.

error

An NSError object if a problem occurred retrieving the shortcut; otherwise, nil.

Discussion

This method only retrieves shortcuts associated with the app that calls the method. It cannot retrieve shortcuts associated with other apps.

See Also

Getting Shortcuts Added to Siri

func getAllVoiceShortcuts(completion: ([INVoiceShortcut]?, Error?) -> Void)

Retrieves all shortcuts added to Siri for your app.