MonoTouch.HealthKit.HKQuantitySample Class
A MonoTouch.HealthKit.HKSample that has a magnitude (see HKQuantitySample.Quantity).

See Also: HKQuantitySample Members

Syntax

[MonoTouch.Foundation.Register("HKQuantitySample", true)]
[MonoTouch.ObjCRuntime.Availability(Introduced=MonoTouch.ObjCRuntime.Platform.iOS_8_0)]
public class HKQuantitySample : HKSample

Remarks

The following examples show how you can create a HKQuantitySample, one using standard C#, and another using named parameters to make their use more obvious:

c# Example

var bodyTemperature = HKQuantityType.Create (HKQuantityTypeIdentifier.BodyTemperature);
var temp = HKQuantity.FromQuantity (HKUnit.DegreeFahrenheit, 99);
var sample = HKQuantitySample.FromType (bodyTemperature, temp, NSDate.Now, NSDate.Now, new HKMetadata () {
	BodyTemperatureSensorLocation = HKBodyTemperatureSensorLocation.Mouth
});

        var sample2 = HKQuantitySample.FromType (
    quantityType: HKQuantityType.Create (HKQuantityTypeIdentifier.BodyTemperature),
    quantity: HKQuantity.FromQuantity (HKUnit.DegreeFahrenheit, 99),
    startDate: NSDate.Now, 
    endDate: NSDate.Now, 
    metadata: new HKMetadata () {
	BodyTemperatureSensorLocation = HKBodyTemperatureSensorLocation.Mouth
    }
);

Related content

Requirements

Namespace: MonoTouch.HealthKit
Assembly: monotouch (in monotouch.dll)
Assembly Versions: 0.0.0.0