Instance Method

confirm(intent:completion:)

Called when it is time for you to confirm the details of the cancellation.

Declaration

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

Parameters

intent

The intent object containing details about the user’s request. Use the information in this object to get the information specified 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 containing the status of whether your app is able to cancel the workout. This parameter must not be nil.

Discussion

Use this method to validate that your app is currently able to cancel the user’s workout. You might check to verify that a workout is currently in progress and can be canceled.