Last active
July 9, 2018 11:19
-
-
Save PattoMotto/3bd4cb3d354323e9b4930591c6b1aa54 to your computer and use it in GitHub Desktop.
Custom intent handler, full project https://github.com/neungnarakjung/CookBook-Siri-Shortcuts-Example
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 Foundation | |
final class CookBookIntentHandler: NSObject, CookBookIntentHandling { | |
func handle(intent: CookBookIntent, completion: @escaping (CookBookIntentResponse) -> Void) { | |
guard let recipe = intent.recipe else { | |
completion(CookBookIntentResponse(code: .failure, userActivity: nil)) | |
return | |
} | |
completion(CookBookIntentResponse.success(recipe: recipe)) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment