Type Method

workoutType()

Returns the shared HKWorkoutType object.

Declaration

class func workoutType() -> HKWorkoutType

Return Value

The shared HKWorkoutType instance.

Discussion

This method returns an instance of the HKWorkoutType concrete subclass. HealthKit uses workout types to create samples that store information about individual workouts. Use workout type instances to create workout objects that you can save in the HealthKit store. For more information, see HKWorkoutType.

In HealthKit, all workouts use the same workout type.

See Also

Creating Subclasses

class func categoryType(forIdentifier: HKCategoryTypeIdentifier)

Returns the shared HKCategoryType object for the provided identifier.

class func characteristicType(forIdentifier: HKCharacteristicTypeIdentifier)

Returns the shared HKCharacteristicType object for the provided identifier.

class func documentType(forIdentifier: HKDocumentTypeIdentifier)

Returns the shared HKDocumentType object for the provided identifier.

class func quantityType(forIdentifier: HKQuantityTypeIdentifier)

Returns the shared HKQuantityType object for the provided identifier.