Below code explains how to use multiple app intent shortcuts. You MUST use include (.applicationName) in phrases for each shortcuts to be visible in shortcut app and in spotlight section.
@available(iOS 16, *)
struct MyAppIntentShortcutsProvider: AppShortcutsProvider {
@AppShortcutsBuilder static var appShortcuts: [AppShortcut] {
AppShortcut(
intent: ShortcutIntentOne(),
phrases: [
"Create \(.applicationName) intent",
],
shortTitle: "first one",
systemImageName: "person.fill.badge.plus"
)
AppShortcut(
intent: ShortcutIntentTwo(),
phrases: [
"Create \(.applicationName) intent two",
],
shortTitle: "second one",
systemImageName: "list.clipboard.fill"
)
}
}
Topic:
Programming Languages
SubTopic:
Swift
Tags: