Contents

ResumeWorkoutIntent

An App Intent that lets someone resume your app’s paused workout session.

Declaration

protocol ResumeWorkoutIntent : SystemIntent

Mentioned in

Overview

On Apple Watch Ultra, someone can resume your app’s workout by simultaneously pressing the Action button and the side button when your app has a paused workout session.

To implement the resume action, create a structure that adopts the ResumeWorkoutIntent protocol.

struct MyResumeWorkoutIntent: ResumeWorkoutIntent {
    static var title: LocalizedStringResource = "Resume Workout"

    func perform() async throws -> some IntentResult {
        logger.debug("*** Performing a resume intent. ***")
        await MyWorkoutManager.shared.resumeWorkout()
        return .result()
    }
}

This intent needs a title property that provides a localized description of the action, and a perform() method, which the system calls when it triggers the intent.

For more information, see Responding to the Action button on Apple Watch Ultra.

See Also

Responding to the Action button