Created
January 18, 2017 07:52
-
-
Save fozoglu/72614a5fb0519bc3dc3173e69b0b4985 to your computer and use it in GitHub Desktop.
HealthKitManager class örneği en sade hali
This file contains hidden or 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
import HealthKit | |
class HealthKitManager { | |
class var sharedInstance: HealthKitManager { | |
struct Singleton { | |
static let instance = HealthKitManager() | |
} | |
return Singleton.instance | |
} | |
let healthStore: HKHealthStore? = { | |
if HKHealthStore.isHealthDataAvailable() { | |
return HKHealthStore() | |
} else { | |
return nil | |
} | |
}() | |
let stepsCount = HKQuantityType.quantityType(forIdentifier: HKQuantityTypeIdentifier.stepCount) | |
let stepsUnit = HKUnit.count() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment