Skip to content

Instantly share code, notes, and snippets.

@eyepaq
eyepaq / gist:b2e94ecb09b8d39df72c11d2fa7d3527
Created July 22, 2021 12:09
async call disassembly in Swift
class TestClassSync {
func calc() -> Int {
return 100
}
func run() -> Int {
return 100 + calc()
}
}
@eyepaq
eyepaq / HealthKitImport.swift
Created February 25, 2018 03:50
Quick and dirty import of CSV data into HealthKit .bodyMass measurements. I used this to import my Withings health data export.
/**
Quick and dirty CSV importer, only used once by me to import my own data, sharing it here
in case anyone finds it useful.
*/
class HealthKitCSVImporter {
let healthStore = HKHealthStore()
let bodyMassType = HKSampleType.quantityType(forIdentifier: .bodyMass)!
func authorizeHealthKit(completion: @escaping ((_ success: Bool, _ error: Error?) -> Void)) {