ORKHealthQuantityTypeRecorderConfiguration Class Reference
Inherits from | ORKRecorderConfiguration : NSObject |
---|---|
Declared in | ORKRecorder.h |
The ORKHealthQuantityTypeRecorderConfiguration
class represents a configuration
that records data from a HealthKit quantity type during an active step.
Before you can use this configuration, you must use Xcode to enable the appropriate HealthKit entitlement for your app.
HealthKit quantity type data is serialized to JSON and returned as an ORKFileResult
object.
For details on the format, see HKSample+ORKJSONDictionary
.
To use a recorder, include its configuration in the recorderConfigurations
property
of an ORKActiveStep
object, include that step in a task, and present it with
a task view controller.
– initWithIdentifier:healthQuantityType:unit:
Returns an initialized health quantity type recorder configuration using the specified quantity type and unit designation.
- (instancetype)initWithIdentifier:(NSString *)identifier healthQuantityType:(HKQuantityType *)quantityType unit:(HKUnit *)unit
Parameters
identifier |
The unique identifier of the recorder configuration. |
---|---|
quantityType |
The quantity type that should be collected during the active task. |
unit |
The unit for the data that should be collected and serialized. |
Return Value
An initialized health quantity type recorder configuration.
Discussion
This method is the designated initializer.
Declared In
ORKRecorder.h
– initWithCoder:
Returns a new health quantity type recorder configuration initialized from data in the given unarchiver.
- (instancetype)initWithCoder:(NSCoder *)aDecoder
Parameters
aDecoder |
Coder from which to initialize the health quantity type recorder configuration. |
---|
Return Value
A new health quantity type recorder configuration.
Declared In
ORKRecorder.h
quantityType
The quantity type to be collected from HealthKit. (read-only)
@property (nonatomic, readonly, copy) HKQuantityType *quantityType
Declared In
ORKRecorder.h
unit
The unit in which to serialize the data from HealthKit. (read-only)
@property (nonatomic, readonly, copy) HKUnit *unit
Declared In
ORKRecorder.h