Skip to content

apdevzhang/HealthKitUsageDemo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

skoal

License  Platform  Support  Cocoapods  Language  Language 

  Skoal is a healthkit based library that supports reading and writing healthstore properties

Supported Properties

Sample HealthKit Identifier Type Read Write
StepCount HKQuantityTypeIdentifierStepCount
Height HKQuantityTypeIdentifierHeight
BodyMass HKQuantityTypeIdentifierBodyMass
BodyMassIndex HKQuantityTypeIdentifierBodyMassIndex
DistanceWalkingRunning HKQuantityTypeIdentifierDistanceWalkingRunning
FlightsClimbed HKQuantityTypeIdentifierFlightsClimbed
RespiratoryRate HKQuantityTypeIdentifierRespiratoryRate
DietaryEnergyConsumed HKQuantityTypeIdentifierDietaryEnergyConsumed
OxygenSaturation HKQuantityTypeIdentifierOxygenSaturation
BodyTemperature HKQuantityTypeIdentifierBodyTemperature
BloodGlucose HKQuantityTypeIdentifierBloodGlucose
BloodPressureSystolic HKQuantityTypeIdentifierBloodPressureSystolic
BloodPressureDiastolic HKQuantityTypeIdentifierBloodPressureDiastolic
StandHour HKCategoryTypeIdentifierAppleStandHour
BiologicalSex biologicalSexWithError
DateOfBirth dateOfBirthComponentsWithError
BloodType bloodTypeWithError
FitzpatrickSkin fitzpatrickSkinTypeWithError
SleepAnalysis HKCategoryTypeIdentifierSleepAnalysis
MenstrualFlow HKCategoryTypeIdentifierMenstrualFlow
IntermenstrualBleeding HKCategoryTypeIdentifierIntermenstrualBleeding
SexualActivity HKCategoryTypeIdentifierSexualActivity

License

skoaluse MIT license

Usage

  • Objective-C
      [[skoal sharedInstance]requestHealthPermissionWithBlock:^(HealthStorePermissionResponse permissionResponse) {
            if (permissionResponse == HealthStorePermissionResponseError) {
                DLog(@"请求权限失败");
            }else{
                DLog(@"请求权限成功");
            }
        }];
  • Swift
             skoal.sharedInstance().requestHealthPermission { (response: HealthStorePermissionResponse) in
                 if response == HealthStorePermissionResponse.error {
                     print("请求失败")
                 } else {
                     print("请求成功")
                }
			}

func preview1 func preview2
screenshot/func1.png screenshot/func2.png

About

Both read and write function for variety health-related property from your iPhone based on HealthKit

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published