forked from LoopKit/Loop
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHKUnit.swift
More file actions
32 lines (25 loc) · 931 Bytes
/
HKUnit.swift
File metadata and controls
32 lines (25 loc) · 931 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
//
// HKUnit.swift
// Naterade
//
// Created by Nathan Racklyeft on 1/17/16.
// Copyright © 2016 Nathan Racklyeft. All rights reserved.
//
import HealthKit
extension HKUnit {
public static let milligramsPerDeciliter: HKUnit = {
return HKUnit.gramUnit(with: .milli).unitDivided(by: .literUnit(with: .deci))
}()
public static let millimolesPerLiter: HKUnit = {
return HKUnit.moleUnit(with: .milli, molarMass: HKUnitMolarMassBloodGlucose).unitDivided(by: .liter())
}()
public static let milligramsPerDeciliterPerMinute: HKUnit = {
return HKUnit.milligramsPerDeciliter.unitDivided(by: .minute())
}()
public static let millimolesPerLiterPerMinute: HKUnit = {
return HKUnit.millimolesPerLiter.unitDivided(by: .minute())
}()
public static let internationalUnitsPerHour: HKUnit = {
return HKUnit.internationalUnit().unitDivided(by: .hour())
}()
}