Instance Method

handle(intent:completion:)

Called when it is time for you to cancel the workout.

Required.

Declaration

func handle(intent: INCancelWorkoutIntent, completion: @escaping (INCancelWorkoutIntentResponse) -> Void)

Parameters

intent

The intent object containing details about the user’s request. The information in this object has already been resolved and confirmed by the user.

completion

The handler block to execute with your response. You must execute this handler at some point during your implementation of this method. This handler has no return value and takes the following parameter:

response

The INCancelWorkoutIntentResponse object you create to report the status of the request. This parameter must not be nil.

Discussion

Use this method to turn control of starting the workout over to your app. When your response object contains the INCancelWorkoutIntentResponseCode.continueInApp code, SiriKit automatically launches your app and passes it the NSUserActivity object from your response object.