---
title: "init(type:date:metadata:)"
framework: healthkit
role: symbol
role_heading: Initializer
path: "healthkit/hkworkoutevent/init(type:date:metadata:)"
---

# init(type:date:metadata:)

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

## Declaration

```swift
convenience init(type: HKWorkoutEventType, date: Date, metadata: [String : Any])
```

## Parameters

- `type`: The type of workout event. For a description of possible events, see doc://com.apple.healthkit/documentation/HealthKit/HKWorkoutEventType.
- `date`: The time when the transition occurred. For a pause event, this date indicates the start of the break. For a resume event, this date indicates the end of the break. You must use a date between the starting and ending dates of the workout that you intend to modify.
- `metadata`: The metadata associated with the workout event.

## See Also

### Deprecated

- [init(type:date:)](healthkit/hkworkoutevent/init(type:date:).md)
- [date](healthkit/hkworkoutevent/date.md)
