Skip to content

Latest commit

 

History

History
16 lines (14 loc) · 570 Bytes

README.md

File metadata and controls

16 lines (14 loc) · 570 Bytes

Gladstone

An experiment to see if the HealthKit querying api can be simplified into something that resembles Alamofire

Gladstone.latest(.activeEnergyBurned).results({ sample in
    debugPrint("Latest sample for active energy burned: \(sample as Any)")
})

Gladstone.query(for: .heartRate)
    .sorted(withSortDescriptors: [NSSortDescriptor.init(key: HKSampleSortIdentifierStartDate, ascending: false)])
    .limited(numberOfSamples: 10)
    .excludeSource(withBundleIdentifier: "com.apple")
    .results { results in
        debugPrint(results as Any)
}