46.15 Modifying the Intent Handler Code
Now that the intent definition is complete and the classes have been auto-generated by Xcode, the intent handler needs to be modified to implement the BuyStockIntentHandling protocol.
Edit the IntentHandler.swift file and make the following changes:
import Intents
class IntentHandler: INExtension, BuyStockIntentHandling {
override func handler(for intent: INIntent) -> Any {
guard intent is BuyStockIntent else {
fatalError("Unknown intent type: \(intent)")
}
return self
}
func handle(intent: BuyStockIntent,
completion...