One Logo Pool Ball
HealthKit · IOS API REFERENCE

HKQuantitySample

class · iOS 8.0+ · SDK 27.1

class HKQuantitySample

Members (6)

init · iOS 8.0+

init

TypeScript
static initTypeQuantityStartEnd(quantityType: HKQuantityType, quantity: HKQuantity, startDate: globalThis.Date, endDate: globalThis.Date): HKQuantitySample
Swift declaration
convenience init(type quantityType: HKQuantityType, quantity: HKQuantity, start startDate: Date, end endDate: Date)
init · iOS 9.0+

init

TypeScript
static initTypeQuantityStartEndDeviceMetadata(quantityType: HKQuantityType, quantity: HKQuantity, startDate: globalThis.Date, endDate: globalThis.Date, device?: (HKDevice) | null, metadata?: (Record<string, unknown>) | null): HKQuantitySample
Swift declaration
convenience init(type quantityType: HKQuantityType, quantity: HKQuantity, start startDate: Date, end endDate: Date, device: HKDevice?, metadata: [String : Any]?)
init · iOS 8.0+

init

TypeScript
static initTypeQuantityStartEndMetadata(quantityType: HKQuantityType, quantity: HKQuantity, startDate: globalThis.Date, endDate: globalThis.Date, metadata?: (Record<string, unknown>) | null): HKQuantitySample
Swift declaration
convenience init(type quantityType: HKQuantityType, quantity: HKQuantity, start startDate: Date, end endDate: Date, metadata: [String : Any]?)
get · iOS 12.0+

count

TypeScript
get count(): number
Swift declaration
var count: Int { get }
get · iOS 8.0+

quantity

TypeScript
get quantity(): HKQuantity
Swift declaration
@NSCopying var quantity: HKQuantity { get }
get · iOS 8.0+

quantityType

TypeScript
get quantityType(): HKQuantityType
Swift declaration
@NSCopying var quantityType: HKQuantityType { get }

Skipped declarations

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

HKQuantitySample.init()

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

All HealthKit types →