<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 13.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "HealthKit",
  "identifier" : "/documentation/HealthKit/HKWorkoutEvent",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "HealthKit"
    ],
    "preciseIdentifier" : "c:objc(cs)HKWorkoutEvent"
  },
  "title" : "HKWorkoutEvent"
}
-->

# HKWorkoutEvent

An object representing an important event during a workout.

```
class HKWorkoutEvent
```

## Overview

You can use workout events to toggle a workout between an active and an inactive state, or to mark points of interest during a workout.

Workouts start in an active state. A pause event switches it to an inactive state; a resume event switches it back to an active state. Adding a pause event when the workout is already inactive, or a resume event when the workout is already active, does not affect the workout’s state. These events are ignored.

The lap, segment, and marker events are used to identify periods of interest during a workout. Use lap events to partition a workout into segments of equal distance. Segment events mark important periods during the workout, while markers identify important points in time.

## Topics

### Creating workout events

[`+  workoutEventWithType:dateInterval:metadata:`](/documentation/HealthKit/HKWorkoutEvent/init(type:dateInterval:metadata:))

Instantiates and returns a new workout event with the specified type, date interval, and metadata.

### Getting property data

[`dateInterval`](/documentation/HealthKit/HKWorkoutEvent/dateInterval)

The time and duration of the event.

[`type`](/documentation/HealthKit/HKWorkoutEvent/type)

The type of workout event.

[`metadata`](/documentation/HealthKit/HKWorkoutEvent/metadata)

The metadata associated with the workout event.

### Determining the event type

[`HKWorkoutEventType`](/documentation/HealthKit/HKWorkoutEventType)

Constants that represent events occurring during a workout.

### Deprecated

[`+  workoutEventWithType:date:`](/documentation/HealthKit/HKWorkoutEvent/init(type:date:))

Instantiates and returns a new workout event with the specified type and date.

[`+  workoutEventWithType:date:metadata:`](/documentation/HealthKit/HKWorkoutEvent/init(type:date:metadata:))

Instantiates and returns a new workout event with the specified type, date, and metadata.

[`date`](/documentation/HealthKit/HKWorkoutEvent/date)

The time when the transition occurred.

## Relationships

### Conforms To

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`Sendable`](/documentation/Swift/Sendable)

[`NSCoding`](/documentation/Foundation/NSCoding)

[`Hashable`](/documentation/Swift/Hashable)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`CVarArg`](/documentation/Swift/CVarArg)

[`Equatable`](/documentation/Swift/Equatable)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`NSSecureCoding`](/documentation/Foundation/NSSecureCoding)

[`NSCopying`](/documentation/Foundation/NSCopying)

### Inherits From

[`NSObject-swift.class`](/documentation/ObjectiveC/NSObject-swift.class)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)