Contents

init(type:dateInterval:metadata:)

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

Declaration

convenience init(type: HKWorkoutEventType, dateInterval: DateInterval, metadata: [String : Any]?)

Parameters

  • type:

    The type of workout event. For a description of possible events, see Hkworkouteventtype.

  • dateInterval:

    Most event types support only date intervals with a zero-length duration. These intervals indicate a single point in time, represented by the interval’s Startdate property. Only Lap and Segment event types support intervals with nonzero durations.

  • metadata:

    The metadata associated with the workout event.

Return Value

A new workout event.