Created
July 27, 2018 17:23
-
-
Save azamsharp/a3c23cb9c2a289b3cb1d4d6800594d9c 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 Intents | |
class IntentHandler: INExtension, OrderCoffeeIntentHandling { | |
func confirm(intent: OrderCoffeeIntent, completion: @escaping (OrderCoffeeIntentResponse) -> Void) { | |
completion(OrderCoffeeIntentResponse(code: .ready, userActivity: nil)) | |
} | |
func handle(intent: OrderCoffeeIntent, completion: @escaping (OrderCoffeeIntentResponse) -> Void) { | |
// place an order here | |
// if there are no errors in placing the order we will | |
// return success | |
completion(OrderCoffeeIntentResponse(code: .success, userActivity: nil)) | |
} | |
override func handler(for intent: INIntent) -> Any { | |
// This is the default implementation. If you want different objects to handle different intents, | |
// you can override this and return the handler you want for that particular intent. | |
return self | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment