Last active
September 11, 2022 15:48
-
-
Save HunterHillegas/92839a14c2b24572f6ff2aca0460f3c5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import AppIntents | |
// Compiles but does not work | |
struct VegasMateShortcuts: AppShortcutsProvider { | |
static var appShortcuts: [AppShortcut] { | |
return [ | |
AppShortcut(intent: ViewNextTripIntent(), phrases: [ | |
"View my next trip in \(.applicationName)", | |
"View my next Vegas trip in \(.applicationName)", | |
"Show my \(.applicationName) trips" | |
]), | |
AppShortcut(intent: AddHotelToTripIntent(), phrases: [ | |
"Add a hotel to my trip in \(.applicationName)", | |
]), | |
AppShortcut(intent: RecordWinOrLossIntent(), phrases: [ | |
"Record a win or less in \(.applicationName)" | |
]) | |
] | |
} | |
} | |
// This works - note the builder syntax instead of the array | |
struct VegasMateShortcuts: AppShortcutsProvider { | |
static var appShortcuts: [AppShortcut] { | |
AppShortcut(intent: ViewNextTripIntent(), phrases: [ | |
"View my next trip in \(.applicationName)", | |
"View my next Vegas trip in \(.applicationName)", | |
"Show my \(.applicationName) trips" | |
]) | |
AppShortcut(intent: AddHotelToTripIntent(), phrases: [ | |
"Add a hotel to my trip in \(.applicationName)", | |
]) | |
AppShortcut(intent: RecordWinOrLossIntent(), phrases: [ | |
"Record a win or less in \(.applicationName)" | |
]) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The above will compile but won't work. Use builder syntax instead.