Skip to content

Instantly share code, notes, and snippets.

@PattoMotto
Last active July 9, 2018 11:19
Show Gist options
  • Save PattoMotto/3bd4cb3d354323e9b4930591c6b1aa54 to your computer and use it in GitHub Desktop.
Save PattoMotto/3bd4cb3d354323e9b4930591c6b1aa54 to your computer and use it in GitHub Desktop.
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