One Logo Pool Ball
HealthKit · IOS API REFERENCE

HKCategorySample

class · iOS 8.0+ · SDK 27.1

class HKCategorySample

Members (5)

init · iOS 8.0+

init

TypeScript
static initTypeValueStartEnd(type: HKCategoryType, value: number, startDate: globalThis.Date, endDate: globalThis.Date): HKCategorySample
Swift declaration
convenience init(type: HKCategoryType, value: Int, start startDate: Date, end endDate: Date)
init · iOS 9.0+

init

TypeScript
static initTypeValueStartEndDeviceMetadata(type: HKCategoryType, value: number, startDate: globalThis.Date, endDate: globalThis.Date, device?: (HKDevice) | null, metadata?: (Record<string, unknown>) | null): HKCategorySample
Swift declaration
convenience init(type: HKCategoryType, value: Int, start startDate: Date, end endDate: Date, device: HKDevice?, metadata: [String : Any]?)
init · iOS 8.0+

init

TypeScript
static initTypeValueStartEndMetadata(type: HKCategoryType, value: number, startDate: globalThis.Date, endDate: globalThis.Date, metadata?: (Record<string, unknown>) | null): HKCategorySample
Swift declaration
convenience init(type: HKCategoryType, value: Int, start startDate: Date, end endDate: Date, metadata: [String : Any]?)
get · iOS 8.0+

categoryType

TypeScript
get categoryType(): HKCategoryType
Swift declaration
var categoryType: HKCategoryType { get }
get · iOS 8.0+

value

TypeScript
get value(): number
Swift declaration
var value: Int { get }

Skipped declarations

1 declarations were excluded from these bindings. Each reason comes from the generator or the iOS SDK compiler.

HKCategorySample.init()

inherited init: cannot prove legal (class declares 6 custom initializers)

All HealthKit types →