LogHealthSample
public struct LogHealthSample<MeasurementType> : Shortcut where MeasurementType : HealthMeasurementType
Adds a data point into the Health app. You can log anything that the Health app supports, including your weight, steps taken, running distance, caloric intake and more.
Result: Health sample
-
The contents of the shortcut.
Declaration
Swift
public var body: some Shortcut { get } -
Initializes the shortcut.
Declaration
Swift
public init(type: HealthSampleType<MeasurementType>, value: HealthSampleMeasurement<MeasurementType>, date: Text = "")Parameters
typeThe type of health sample to log.
valueThe value of the health sample.
dateThe date and time of the data point. The current date will be used if you don’t provide a date.
-
Initializes the shortcut.
Declaration
Swift
public init(type: HealthSampleType<MeasurementType>, magnitude: Text, unit: HealthSampleUnit<MeasurementType>, date: Text = "")Parameters
typeThe type of health sample to log.
magnitudeThe size of the health sample.
unitThe unit of the health sample.
dateThe date and time of the data point. The current date will be used if you don’t provide a date.
-
Initializes the shortcut.
Declaration
Swift
public init(type: HealthSampleType<MeasurementType>, magnitude: Variable, unit: HealthSampleUnit<MeasurementType>, date: Text = "")Parameters
typeThe type of health sample to log.
magnitudeThe size of the health sample, as a
Variable.unitThe unit of the health sample.
dateThe date and time of the data point. The current date will be used if you don’t provide a date.
View on GitHub
LogHealthSample Structure Reference