Contents

getVoiceShortcut(with:completion:)

Retrieves a shortcut the user added to Siri.

Declaration

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

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