- I want to say something in one shot like: "Start my intent
that does command xyz"
- It currently breaks it down into 2 separate steps, where I have to specify "Start my intent" first then tell the command.
How can I do that in one shot?
struct MyIntent: AppIntent {
static var title = LocalizedStringResource("Start My Intent")
static var openAppWhenRun: Bool = true
static var description = IntentDescription(
"Start my intent"
)
@Parameter(title: "My Intent Command", description: "Say anything you want to ask") var context: String
@MainActor
func perform() async throws -> some IntentResult & ReturnsValue<String> {
UserDefaults.standard.set(context, forKey: "my.intent.command")
AppBridge.processIntent(with: context)
return .result(value: "\(context)")
}