init(intent:phrases:shortTitle:systemImageName:parameterPresentation:)
Initializes an App Shortcut with phrases that run the app intent, a title, an image, and specified parameters.
Declaration
init<Intent, Value, Parameter, ParameterKeyPath>(intent: Intent, phrases: [AppShortcutPhrase<Intent>], shortTitle: LocalizedStringResource, systemImageName: String, parameterPresentation: AppShortcutParameterPresentation<Intent, Value, Parameter, ParameterKeyPath>) where Intent : AppIntent, Value : _IntentValue, Value : Sendable, Parameter : IntentParameter<Value>, ParameterKeyPath : KeyPath<Intent, Parameter>Parameters
- intent:
The
AppIntentassociated with theAppShortcut. - phrases:
An array of
AppShortcutPhrasesassociated with theAppShortcut. - shortTitle:
A
LocalizedStringResourcerepresenting the short title of theAppShortcut. - systemImageName:
A
Stringrepresenting the system image name for theAppShortcut. - parameterPresentation:
An
AppShortcutParameterPresentationobject associated with theAppShortcut.
Discussion
Use this initializer to create an App Shortcut for your app intent that people discover in the Shortcuts app and that they can run using the Action button on supported iPhone models.