Skip to content

Instantly share code, notes, and snippets.

@fozoglu
Created January 18, 2017 07:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fozoglu/72614a5fb0519bc3dc3173e69b0b4985 to your computer and use it in GitHub Desktop.
Save fozoglu/72614a5fb0519bc3dc3173e69b0b4985 to your computer and use it in GitHub Desktop.
HealthKitManager class örneği en sade hali
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