Protocol

INStartWorkoutIntentHandling

Handles the starting of a workout.

Overview

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

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

Topics

Handling the Intent

func handle(intent: INStartWorkoutIntent, completion: (INStartWorkoutIntentResponse) -> Void)

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

Required.

Confirming the Response

func confirm(intent: INStartWorkoutIntent, completion: (INStartWorkoutIntentResponse) -> Void)

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

Resolving Details of the Intent

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

Called when you need to resolve the name of the workout selected by the user.

func resolveGoalValue(for: INStartWorkoutIntent, with: (INDoubleResolutionResult) -> Void)

Called when you need to resolve the numerical goal of the user’s workout.

func resolveIsOpenEnded(for: INStartWorkoutIntent, with: (INBooleanResolutionResult) -> Void)

Called when you need to resolve whether the user’s workout is open ended.

Relationships

Inherits From

See Also

Start a Workout

class INStartWorkoutIntent

Starts a workout for the user.

class INStartWorkoutIntentResponse

Contains your app’s response to a start workout intent.