Swift |
@IBOutlet weak var aButton: UIButton!
@IBAction func buttonTapped(sender : AnyObject){
let healthKitStore:HKHealthStore = HKHealthStore()
let healthKitTypesToWrite = Set(
arrayLiteral: HKObjectType.quantityTypeForIdentifier(HKQuantityTypeIdentifierDietaryPotassium)! )
healthKitStore.requestAuthorizationToShareTypes(healthKitTypesToWrite, readTypes:nil){ (success, error) -> Void in
if success == false {
}
}
}