Last active
May 29, 2018 02:42
-
-
Save vichudson1/9dc94ab8e52f7b647ac0bea2dc0d5c01 to your computer and use it in GitHub Desktop.
Code Snippet for http://vichudson1.micro.blog/2018/05/26/health-up-diaries.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public enum Result<Value, Error> { | |
case success(Value) | |
case failure(Error) | |
} | |
public enum HealthUpQueryError: Error { | |
case noSamplesReturned | |
case undefinedError | |
} | |
public typealias BaseSampleResult = Result<[HKSample], Error> | |
public typealias BaseSampleQueryResultsHandler = (HKQuery , BaseSampleResult) -> () | |
public typealias QuantitySampleResult = Result<[HKQuantitySample], Error> | |
public typealias QuantitySampleQueryResultsHandler = (HKQuery , QuantitySampleResult) -> () | |
public typealias CategorySampleResult = Result<[HKCategorySample], Error> | |
public typealias CategorySampleQueryResultsHandler = (HKQuery ,CategorySampleResult) -> () |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment