handle(intent:completion:)
handle(intent:completion:)
handle(intent:completion:) Instance Method of INStartWorkoutIntentHandling Handles starting the workout.
func handle(intent: INStartWorkoutIntent, completion: @escaping @Sendable (INStartWorkoutIntentResponse) -> Void)Parameters
intent
The intent object that contains details about the user’s request. The object’s information has already been resolved and confirmed by the user.
completion
The handler block to execute with your response. You must execute this handler while implementing this method. This handler has no return value and takes the following parameter: - term response: The `doc://com.apple.sirikit/documentation/Intents/INStartWorkoutIntentResponse object you create to report the status of the request. This parameter must not be nil`.
Discussion
Use this method to transfer control of starting the workout to your app. When your response object contains the INStartWorkoutIntentResponseCode.continueInApp code, SiriKit automatically launches your app and passes it the //com.apple.documentation/documentation/Foundation/NSUserActivity object from your response object.