Protocol

INEndWorkoutIntentHandling

The handler interface for completing a workout.

Overview

Use the methods of the INEndWorkoutIntentHandling protocol to resolve, confirm, and handle requests to end a workout using your app. Adopt this protocol in an object of your Intents extension that is capable of validating the workout name.

You do not actually end the workout from your Intents extension. When your handle(intent:completion:) returns, SiriKit launches your app and passes it an NSUserActivity object containing the end workout intent object and your response. Your app uses the information in those objects to end the workout.

Topics

Handling the Intent

func handle(intent: INEndWorkoutIntent, completion: (INEndWorkoutIntentResponse) -> Void)

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

Required.

Confirming the Response

func confirm(intent: INEndWorkoutIntent, completion: (INEndWorkoutIntentResponse) -> Void)

Called when it is time for you to confirm that you can end the workout.

Resolving Details of the Intent

func resolveWorkoutName(for: INEndWorkoutIntent, with: (INSpeakableStringResolutionResult) -> Void)

Called when you need to resolve the name of the workout that the user wants to end.

Relationships

Inherits From

See Also

End a Workout

class INEndWorkoutIntent

A request to end the current workout and saves the results.

class INEndWorkoutIntentResponse

Contains your app’s response to an end workout intent.