Slide 116
Slide 116 text
INTENT HANDLER SETUP
public class AddTripIntentHandler: NSObject, EditTripIntentHandling {
// Optional!
public func confirm(intent: EditTripIntent,
completion: @escaping (EditTriptIntentResponse) -> Void) {
// Figure out if the thing can be done
}
public func handle(intent: EditTripIntent,
completion: @escaping (EditTripIntentResponse) -> Void) {
// Do the thing!
completion(.success(name: name, destination: destination))
}
}