@@ -61,6 +61,12 @@ - (nullable HKObjectType *)getReadPermFromText:(nonnull NSString*)key {
61
61
return [HKObjectType quantityTypeForIdentifier: HKQuantityTypeIdentifierStepCount];
62
62
} else if ([@" DistanceWalkingRunning" isEqualToString: key]) {
63
63
return [HKObjectType quantityTypeForIdentifier: HKQuantityTypeIdentifierDistanceWalkingRunning];
64
+ } else if ([@" RunningSpeed" isEqualToString: key]) {
65
+ if (@available (iOS 16.0 , *)) {
66
+ return [HKObjectType quantityTypeForIdentifier: HKQuantityTypeIdentifierRunningSpeed];
67
+ } else {
68
+ return nil ;
69
+ }
64
70
} else if ([@" DistanceCycling" isEqualToString: key]) {
65
71
return [HKObjectType quantityTypeForIdentifier: HKQuantityTypeIdentifierDistanceCycling];
66
72
} else if ([@" DistanceSwimming" isEqualToString: key]) {
@@ -77,6 +83,30 @@ - (nullable HKObjectType *)getReadPermFromText:(nonnull NSString*)key {
77
83
return [HKObjectType quantityTypeForIdentifier: HKQuantityTypeIdentifierAppleStandTime];
78
84
} else if ([@" AppleExerciseTime" isEqualToString: key] && systemVersion >= 9.3 ) {
79
85
return [HKObjectType quantityTypeForIdentifier: HKQuantityTypeIdentifierAppleExerciseTime];
86
+ } else if ([@" RunningPower" isEqualToString: key]) {
87
+ if (@available (iOS 16.0 , *)) {
88
+ return [HKObjectType quantityTypeForIdentifier: HKQuantityTypeIdentifierRunningPower];
89
+ } else {
90
+ return nil ;
91
+ }
92
+ } else if ([@" RunningStrideLength" isEqualToString: key]) {
93
+ if (@available (iOS 16.0 , *)) {
94
+ return [HKObjectType quantityTypeForIdentifier: HKQuantityTypeIdentifierRunningStrideLength];
95
+ } else {
96
+ return nil ;
97
+ }
98
+ } else if ([@" RunningVerticalOscillation" isEqualToString: key]) {
99
+ if (@available (iOS 16.0 , *)) {
100
+ return [HKObjectType quantityTypeForIdentifier: HKQuantityTypeIdentifierRunningVerticalOscillation];
101
+ } else {
102
+ return nil ;
103
+ }
104
+ } else if ([@" RunningGroundContactTime" isEqualToString: key]) {
105
+ if (@available (iOS 16.0 , *)) {
106
+ return [HKObjectType quantityTypeForIdentifier: HKQuantityTypeIdentifierRunningGroundContactTime];
107
+ } else {
108
+ return nil ;
109
+ }
80
110
}
81
111
82
112
// Nutrition Identifiers
@@ -266,6 +296,12 @@ - (nullable HKObjectType *)getWritePermFromText:(nonnull NSString*) key {
266
296
return [HKObjectType quantityTypeForIdentifier: HKQuantityTypeIdentifierStepCount];
267
297
} else if ([@" DistanceWalkingRunning" isEqualToString: key]) {
268
298
return [HKObjectType quantityTypeForIdentifier: HKQuantityTypeIdentifierDistanceWalkingRunning];
299
+ } else if ([@" RunningSpeed" isEqualToString: key]) {
300
+ if (@available (iOS 16.0 , *)) {
301
+ return [HKObjectType quantityTypeForIdentifier: HKQuantityTypeIdentifierRunningSpeed];
302
+ } else {
303
+ return nil ;
304
+ }
269
305
} else if ([@" DistanceCycling" isEqualToString: key]) {
270
306
return [HKObjectType quantityTypeForIdentifier: HKQuantityTypeIdentifierDistanceCycling];
271
307
} else if ([@" DistanceSwimming" isEqualToString: key]) {
@@ -276,6 +312,30 @@ - (nullable HKObjectType *)getWritePermFromText:(nonnull NSString*) key {
276
312
return [HKObjectType quantityTypeForIdentifier: HKQuantityTypeIdentifierActiveEnergyBurned];
277
313
} else if ([@" FlightsClimbed" isEqualToString: key]) {
278
314
return [HKObjectType quantityTypeForIdentifier: HKQuantityTypeIdentifierFlightsClimbed];
315
+ } else if ([@" RunningPower" isEqualToString: key]) {
316
+ if (@available (iOS 16.0 , *)) {
317
+ return [HKObjectType quantityTypeForIdentifier: HKQuantityTypeIdentifierRunningPower];
318
+ } else {
319
+ return nil ;
320
+ }
321
+ } else if ([@" RunningStrideLength" isEqualToString: key]) {
322
+ if (@available (iOS 16.0 , *)) {
323
+ return [HKObjectType quantityTypeForIdentifier: HKQuantityTypeIdentifierRunningStrideLength];
324
+ } else {
325
+ return nil ;
326
+ }
327
+ } else if ([@" RunningVerticalOscillation" isEqualToString: key]) {
328
+ if (@available (iOS 16.0 , *)) {
329
+ return [HKObjectType quantityTypeForIdentifier: HKQuantityTypeIdentifierRunningVerticalOscillation];
330
+ } else {
331
+ return nil ;
332
+ }
333
+ } else if ([@" RunningGroundContactTime" isEqualToString: key]) {
334
+ if (@available (iOS 16.0 , *)) {
335
+ return [HKObjectType quantityTypeForIdentifier: HKQuantityTypeIdentifierRunningGroundContactTime];
336
+ } else {
337
+ return nil ;
338
+ }
279
339
}
280
340
281
341
// Nutrition Identifiers
@@ -378,7 +438,11 @@ - (nullable HKObjectType *)getWritePermFromText:(nonnull NSString*) key {
378
438
379
439
// Workout Route
380
440
if ([@" WorkoutRoute" isEqualToString: key]) {
381
- return [HKSeriesType workoutRouteType ];
441
+ if (@available (iOS 11.0 , *)) {
442
+ return [HKSeriesType workoutRouteType ];
443
+ } else {
444
+ return nil ;
445
+ }
382
446
}
383
447
384
448
// Lab and tests
0 commit comments