Hi, I am building a series of App Intents with the new SDK, and I keep facing the issue that in some cases I want to return a result with dialog, others without or others can open an intent.
Here I get an error because I am not specifying in the signature that OpensIntent, but if I do so, I cannot keep the other result simple.
func perform() async throws -> some IntentResult {
do {
try ShortCutsManager.shared.scrollToNextStep()
return .result()
} catch let error {
if let shortcutError = error as? ShortCutsManagerError, shortcutError == ShortCutsManagerError.noMoreSteps {
return .result(opensIntet: NewIntent())
}
throw error
}
}
I made a work around, but then I cannot return a dialog in the second return, and say "well done"
func perform() async throws -> some IntentResult {
do {
try ShortCutsManager.shared.scrollToNextStep()
return .result()
} catch let error {
if let shortcutError = error as? ShortCutsManagerError, shortcutError == ShortCutsManagerError.noMoreSteps {
try await requestConfirmation(output: .result(dialog: "Do you want to mark this recipe as cooked?"){
EmptyView()
})
try doSomething()
return .result("well done!")
}
throw error
}
}
is this even possible? Or is it at least consider for a close future? thanks a lot in advance