ORKHealthKitCharacteristicTypeAnswerFormat Class Reference

Inherits from ORKAnswerFormat : NSObject
Declared in ORKHealthAnswerFormat.h

The ORKHealthKitCharacteristicTypeAnswerFormat class represents an answer format that lets participants enter values that correspond to a HealthKit characteristic type.

The actual UI used for collecting data with this answer format depends on the HealthKit type being collected. The default value displayed in the UI is the most recent value received from HealthKit, if such a value exists. When a step or item is presented using this answer format, authorization is requested.

You can use the HealthKit characteristic answer format to let users autofill information, such as their blood type or date of birth.

+ answerFormatWithCharacteristicType:

Returns a new answer format for the specified HealthKit characteristic type.

+ (instancetype)answerFormatWithCharacteristicType:(HKCharacteristicType *)characteristicType

Parameters

characteristicType

The characteristic type to collect.

Return Value

A new HealthKit characteristic type answer format instance.

Declared In

ORKHealthAnswerFormat.h

– initWithCharacteristicType:

Returns an initialized HealthKit characteristic type answer format using the specified characteristic type.

- (instancetype)initWithCharacteristicType:(HKCharacteristicType *)characteristicType

Parameters

characteristicType

The characteristic type to collect.

Return Value

An initialized HealthKit characteristic type answer format.

Discussion

This method is the designated initializer.

Declared In

ORKHealthAnswerFormat.h

  characteristicType

The HealthKit characteristic type to be collected by this answer format. (read-only)

@property (nonatomic, copy, readonly) HKCharacteristicType *characteristicType

Declared In

ORKHealthAnswerFormat.h