Returns the shared category type for the provided identifier.
SDKs
- iOS 8.0+
- Mac Catalyst 13.0+
- watchOS 2.0+
Framework
- Health
Kit
Declaration
+ (HKCategory Type *)categoryTypeForIdentifier:(HKCategory Type Identifier)identifier;
Parameters
identifier
A category type identifier. For a list of valid identifiers, see
HKCategory
.Type Identifier
Return Value
The shared HKCategory
instance based on the provided identifier.
Discussion
This method returns an instance of the HKCategory
concrete subclass. HealthKit uses category types to represent data that can be categorized into an enumeration of values. Use category type instances to create category samples that you can then save in the HealthKit store. For more information, see HKCategory
.