[HealthKit] Bind Xcode 9 APIs (#2817)
* [HealthKit] Update to Xcode 9 GM * Add new xcode 9 beta APIs * Fix PR comments Marking SyncVersion as an int based on SpeedySloth sample from Apple: guard let version = route.metadata?[HKMetadataKeySyncVersion] as? NSNumber else { print("Route does not have a sync version for route \(route)") return } if version.intValue == 1 { self.makeWorkoutRouteSlothy(workout: workout, route: route) } * Didn't save after deleting the FIXME * Fix build issue * Fix introspection tests * Add new enum values to HKQuantityType.ToKey * QuantityTypeIdentifierTest needs xcode version check for new enum types
This commit is contained in:
Родитель
f2955720b1
Коммит
1595206541
|
@ -240,6 +240,10 @@ namespace XamCore.HealthKit
|
||||||
DistanceSwimming,
|
DistanceSwimming,
|
||||||
[iOS (10,0), Watch (3,0)]
|
[iOS (10,0), Watch (3,0)]
|
||||||
SwimmingStrokeCount,
|
SwimmingStrokeCount,
|
||||||
|
[iOS (11,0), Watch (4,0)]
|
||||||
|
WaistCircumference,
|
||||||
|
[iOS (11, 0), Watch (4, 0)]
|
||||||
|
VO2Max,
|
||||||
}
|
}
|
||||||
|
|
||||||
// Convenience enum, ObjC uses NSString
|
// Convenience enum, ObjC uses NSString
|
||||||
|
@ -318,6 +322,7 @@ namespace XamCore.HealthKit
|
||||||
Lacrosse,
|
Lacrosse,
|
||||||
MartialArts,
|
MartialArts,
|
||||||
MindAndBody,
|
MindAndBody,
|
||||||
|
[Availability (Deprecated = Platform.iOS_11_0 | Platform.Watch_4_0, Message = "Use 'MixedCardio' or 'HighIntensityIntervalTraining' instead.")]
|
||||||
MixedMetabolicCardioTraining,
|
MixedMetabolicCardioTraining,
|
||||||
PaddleSports,
|
PaddleSports,
|
||||||
Play,
|
Play,
|
||||||
|
@ -374,6 +379,12 @@ namespace XamCore.HealthKit
|
||||||
WheelchairWalkPace,
|
WheelchairWalkPace,
|
||||||
[iOS (10,0), Watch (3,0)]
|
[iOS (10,0), Watch (3,0)]
|
||||||
WheelchairRunPace,
|
WheelchairRunPace,
|
||||||
|
[iOS (11,0), Watch (4,0)]
|
||||||
|
TaiChi,
|
||||||
|
[iOS (11, 0), Watch (4, 0)]
|
||||||
|
MixedCardio,
|
||||||
|
[iOS (11, 0), Watch (4, 0)]
|
||||||
|
HandCycling,
|
||||||
[iOS (8,2)]
|
[iOS (8,2)]
|
||||||
Other = 3000
|
Other = 3000
|
||||||
}
|
}
|
||||||
|
@ -392,6 +403,10 @@ namespace XamCore.HealthKit
|
||||||
MotionPaused,
|
MotionPaused,
|
||||||
[iOS (10,0), Watch (3,0)]
|
[iOS (10,0), Watch (3,0)]
|
||||||
MotionResumed,
|
MotionResumed,
|
||||||
|
[iOS (11, 0), Watch (4, 0)]
|
||||||
|
Segment,
|
||||||
|
[iOS (11, 0), Watch (4, 0)]
|
||||||
|
PauseOrResumeRequest,
|
||||||
}
|
}
|
||||||
|
|
||||||
[Watch (2,0)]
|
[Watch (2,0)]
|
||||||
|
@ -514,4 +529,26 @@ namespace XamCore.HealthKit
|
||||||
Breaststroke,
|
Breaststroke,
|
||||||
Butterfly,
|
Butterfly,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Watch (4, 0), iOS (11, 0)]
|
||||||
|
[Native]
|
||||||
|
public enum HKInsulinDeliveryReason : nint {
|
||||||
|
Asal = 1,
|
||||||
|
Olus,
|
||||||
|
}
|
||||||
|
|
||||||
|
[Watch (4, 0), iOS (11, 0)]
|
||||||
|
[Native]
|
||||||
|
public enum HKBloodGlucoseMealTime : nint {
|
||||||
|
Reprandial = 1,
|
||||||
|
Ostprandial,
|
||||||
|
}
|
||||||
|
|
||||||
|
[Watch (4, 0), iOS (11, 0)]
|
||||||
|
[Native]
|
||||||
|
public enum HKVO2MaxTestType : nint {
|
||||||
|
MaxExercise = 1,
|
||||||
|
PredictionSubMaxExercise,
|
||||||
|
PredictionNonExercise,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -238,6 +238,12 @@ namespace XamCore.HealthKit
|
||||||
|
|
||||||
case HKQuantityTypeIdentifier.UVExposure:
|
case HKQuantityTypeIdentifier.UVExposure:
|
||||||
return HKQuantityTypeIdentifierKey.UVExposure;
|
return HKQuantityTypeIdentifierKey.UVExposure;
|
||||||
|
|
||||||
|
case HKQuantityTypeIdentifier.WaistCircumference:
|
||||||
|
return HKQuantityTypeIdentifierKey.WaistCircumference;
|
||||||
|
|
||||||
|
case HKQuantityTypeIdentifier.VO2Max:
|
||||||
|
return HKQuantityTypeIdentifierKey.VO2Max;
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
242
src/healthkit.cs
242
src/healthkit.cs
|
@ -13,6 +13,7 @@ using XamCore.ObjCRuntime;
|
||||||
using XamCore.Foundation;
|
using XamCore.Foundation;
|
||||||
using System;
|
using System;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
|
using XamCore.CoreLocation;
|
||||||
|
|
||||||
namespace XamCore.HealthKit {
|
namespace XamCore.HealthKit {
|
||||||
|
|
||||||
|
@ -60,6 +61,15 @@ namespace XamCore.HealthKit {
|
||||||
Paused,
|
Paused,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[iOS (11,0)]
|
||||||
|
[Watch (4,0)]
|
||||||
|
[Native]
|
||||||
|
public enum HKHeartRateMotionContext : nint {
|
||||||
|
NotSet = 0,
|
||||||
|
Sedentary,
|
||||||
|
Active,
|
||||||
|
}
|
||||||
|
|
||||||
delegate void HKAnchoredObjectResultHandler2 (HKAnchoredObjectQuery query, HKSample[] results, nuint newAnchor, NSError error);
|
delegate void HKAnchoredObjectResultHandler2 (HKAnchoredObjectQuery query, HKSample[] results, nuint newAnchor, NSError error);
|
||||||
#if XAMCORE_2_0
|
#if XAMCORE_2_0
|
||||||
[Obsolete ("Use HKAnchoredObjectResultHandler2 instead")]
|
[Obsolete ("Use HKAnchoredObjectResultHandler2 instead")]
|
||||||
|
@ -70,6 +80,8 @@ namespace XamCore.HealthKit {
|
||||||
|
|
||||||
delegate void HKAnchoredObjectUpdateHandler (HKAnchoredObjectQuery query, HKSample[] addedObjects, HKDeletedObject[] deletedObjects, HKQueryAnchor newAnchor, NSError error);
|
delegate void HKAnchoredObjectUpdateHandler (HKAnchoredObjectQuery query, HKSample[] addedObjects, HKDeletedObject[] deletedObjects, HKQueryAnchor newAnchor, NSError error);
|
||||||
|
|
||||||
|
delegate void HKWorkoutRouteBuilderDataHandler (HKWorkoutRouteQuery query, CLLocation [] routeData, bool done, NSError error);
|
||||||
|
|
||||||
[Watch (2,0)]
|
[Watch (2,0)]
|
||||||
[iOS (8,0)]
|
[iOS (8,0)]
|
||||||
[BaseType (typeof (HKQuery))]
|
[BaseType (typeof (HKQuery))]
|
||||||
|
@ -173,6 +185,10 @@ namespace XamCore.HealthKit {
|
||||||
[Watch (3,0), iOS (10,0)]
|
[Watch (3,0), iOS (10,0)]
|
||||||
[Field ("HKPredicateKeyPathCDACustodianName")]
|
[Field ("HKPredicateKeyPathCDACustodianName")]
|
||||||
NSString CdaCustodianName { get; }
|
NSString CdaCustodianName { get; }
|
||||||
|
|
||||||
|
[Watch (4, 0), iOS (11, 0)]
|
||||||
|
[Field ("HKPredicateKeyPathWorkoutTotalFlightsClimbed")]
|
||||||
|
NSString TotalFlightsClimbed { get; }
|
||||||
}
|
}
|
||||||
|
|
||||||
[NoWatch] // headers says it's available but it's only usable from another, unavailable, type
|
[NoWatch] // headers says it's available but it's only usable from another, unavailable, type
|
||||||
|
@ -586,6 +602,30 @@ namespace XamCore.HealthKit {
|
||||||
[Watch (3,0), iOS (10,0)]
|
[Watch (3,0), iOS (10,0)]
|
||||||
[Export ("SwimmingStrokeStyle")]
|
[Export ("SwimmingStrokeStyle")]
|
||||||
NSString SwimmingStrokeStyle { get; }
|
NSString SwimmingStrokeStyle { get; }
|
||||||
|
|
||||||
|
[Watch (4, 0), iOS (11, 0)]
|
||||||
|
[Export ("SyncIdentifier")]
|
||||||
|
string SyncIdentifier { get; }
|
||||||
|
|
||||||
|
[Watch (4, 0), iOS (11, 0)]
|
||||||
|
[Export ("SyncVersion")]
|
||||||
|
int SyncVersion { get; }
|
||||||
|
|
||||||
|
[Watch (4, 0), iOS (11, 0)]
|
||||||
|
[Export ("InsulinDeliveryReason")]
|
||||||
|
HKInsulinDeliveryReason InsulinDeliveryReason { get; }
|
||||||
|
|
||||||
|
[Watch (4, 0), iOS (11, 0)]
|
||||||
|
[Export ("BloodGlucoseMealTime")]
|
||||||
|
HKBloodGlucoseMealTime BloodGlucoseMealTime { get; }
|
||||||
|
|
||||||
|
[Watch (4, 0), iOS (11, 0)]
|
||||||
|
[Export ("VO2MaxTestType")]
|
||||||
|
HKVO2MaxTestType VO2MaxTestType { get; }
|
||||||
|
|
||||||
|
[Watch (4,0), iOS (11,0)]
|
||||||
|
[Export ("HeartRateMotionContext")]
|
||||||
|
HKHeartRateMotionContext HeartRateMotionContext { get; }
|
||||||
}
|
}
|
||||||
|
|
||||||
[Watch (2,0)]
|
[Watch (2,0)]
|
||||||
|
@ -680,6 +720,30 @@ namespace XamCore.HealthKit {
|
||||||
[Watch (3,0), iOS (10,0)]
|
[Watch (3,0), iOS (10,0)]
|
||||||
[Field ("HKMetadataKeySwimmingStrokeStyle")]
|
[Field ("HKMetadataKeySwimmingStrokeStyle")]
|
||||||
NSString SwimmingStrokeStyle { get; }
|
NSString SwimmingStrokeStyle { get; }
|
||||||
|
|
||||||
|
[Watch (4, 0), iOS (11, 0)]
|
||||||
|
[Field ("HKMetadataKeySyncIdentifier")]
|
||||||
|
NSString SyncIdentifier { get; }
|
||||||
|
|
||||||
|
[Watch (4, 0), iOS (11, 0)]
|
||||||
|
[Field ("HKMetadataKeySyncVersion")]
|
||||||
|
NSString SyncVersion { get; }
|
||||||
|
|
||||||
|
[Watch (4, 0), iOS (11, 0)]
|
||||||
|
[Field ("HKMetadataKeyInsulinDeliveryReason")]
|
||||||
|
NSString InsulinDeliveryReason { get; }
|
||||||
|
|
||||||
|
[Watch (4, 0), iOS (11, 0)]
|
||||||
|
[Field ("HKMetadataKeyBloodGlucoseMealTime")]
|
||||||
|
NSString BloodGlucoseMealTime { get; }
|
||||||
|
|
||||||
|
[Watch (4, 0), iOS (11, 0)]
|
||||||
|
[Field ("HKMetadataKeyVO2MaxTestType")]
|
||||||
|
NSString VO2MaxTestType { get; }
|
||||||
|
|
||||||
|
[Watch (4,0), iOS (11,0)]
|
||||||
|
[Field ("HKMetadataKeyHeartRateMotionContext")]
|
||||||
|
NSString HeartRateMotionContext { get; }
|
||||||
}
|
}
|
||||||
|
|
||||||
[Watch (2,0)]
|
[Watch (2,0)]
|
||||||
|
@ -783,6 +847,12 @@ namespace XamCore.HealthKit {
|
||||||
[Static]
|
[Static]
|
||||||
[Export ("activitySummaryType")]
|
[Export ("activitySummaryType")]
|
||||||
HKActivitySummaryType ActivitySummaryType { get; }
|
HKActivitySummaryType ActivitySummaryType { get; }
|
||||||
|
|
||||||
|
[Watch (4, 0), iOS (11, 0)]
|
||||||
|
[Static]
|
||||||
|
[Export ("seriesTypeForIdentifier:")]
|
||||||
|
[return: NullAllowed]
|
||||||
|
HKSeriesType GetSeriesType (string identifier);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Watch (2,0)]
|
[Watch (2,0)]
|
||||||
|
@ -1008,6 +1078,11 @@ namespace XamCore.HealthKit {
|
||||||
[Export ("predicateForWorkoutsWithOperatorType:totalSwimmingStrokeCount:")]
|
[Export ("predicateForWorkoutsWithOperatorType:totalSwimmingStrokeCount:")]
|
||||||
NSPredicate GetPredicateForTotalSwimmingStrokeCount (NSPredicateOperatorType operatorType, HKQuantity totalSwimmingStrokeCount);
|
NSPredicate GetPredicateForTotalSwimmingStrokeCount (NSPredicateOperatorType operatorType, HKQuantity totalSwimmingStrokeCount);
|
||||||
|
|
||||||
|
[Watch (4, 0), iOS (11, 0)]
|
||||||
|
[Static]
|
||||||
|
[Export ("predicateForWorkoutsWithOperatorType:totalFlightsClimbed:")]
|
||||||
|
NSPredicate GetPredicateForTotalFlightsClimbed (NSPredicateOperatorType operatorType, HKQuantity totalFlightsClimbed);
|
||||||
|
|
||||||
// HKActivitySummaryPredicates
|
// HKActivitySummaryPredicates
|
||||||
|
|
||||||
[iOS (9,3), Watch (2,2)]
|
[iOS (9,3), Watch (2,2)]
|
||||||
|
@ -1304,6 +1379,18 @@ namespace XamCore.HealthKit {
|
||||||
[Field ("HKQuantityTypeIdentifierRespiratoryRate")]
|
[Field ("HKQuantityTypeIdentifierRespiratoryRate")]
|
||||||
NSString RespiratoryRate { get; }
|
NSString RespiratoryRate { get; }
|
||||||
|
|
||||||
|
[iOS (11,0), Watch (4,0)]
|
||||||
|
[Field ("HKQuantityTypeIdentifierRestingHeartRate")]
|
||||||
|
NSString RestingHeartRate { get; }
|
||||||
|
|
||||||
|
[iOS (11,0), Watch (4,0)]
|
||||||
|
[Field ("HKQuantityTypeIdentifierWalkingHeartRateAverage")]
|
||||||
|
NSString WalkingHeartRateAverage { get; }
|
||||||
|
|
||||||
|
[iOS (11,0), Watch (4,0)]
|
||||||
|
[Field ("HKQuantityTypeIdentifierHeartRateVariabilitySDNN")]
|
||||||
|
NSString HeartRateVariabilitySdnn { get; }
|
||||||
|
|
||||||
[Field ("HKQuantityTypeIdentifierBodyTemperature")]
|
[Field ("HKQuantityTypeIdentifierBodyTemperature")]
|
||||||
NSString BodyTemperature { get; }
|
NSString BodyTemperature { get; }
|
||||||
|
|
||||||
|
@ -1434,6 +1521,14 @@ namespace XamCore.HealthKit {
|
||||||
[Field ("HKQuantityTypeIdentifierUVExposure")]
|
[Field ("HKQuantityTypeIdentifierUVExposure")]
|
||||||
NSString UVExposure { get; }
|
NSString UVExposure { get; }
|
||||||
|
|
||||||
|
[Watch (4, 0), iOS (11, 0)]
|
||||||
|
[Field ("HKQuantityTypeIdentifierWaistCircumference")]
|
||||||
|
NSString WaistCircumference { get; }
|
||||||
|
|
||||||
|
[Watch (4, 0), iOS (11, 0)]
|
||||||
|
[Field ("HKQuantityTypeIdentifierVO2Max")]
|
||||||
|
NSString VO2Max { get; }
|
||||||
|
|
||||||
// If you add field, add them to the enum too.
|
// If you add field, add them to the enum too.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1700,6 +1795,7 @@ namespace XamCore.HealthKit {
|
||||||
[Export ("jouleUnit")]
|
[Export ("jouleUnit")]
|
||||||
HKUnit Joule { get; }
|
HKUnit Joule { get; }
|
||||||
|
|
||||||
|
[Availability (Deprecated = Platform.iOS_11_0 | Platform.Watch_4_0, Message = "Use 'SmallCalorie' or 'LargeCalorie' instead.")]
|
||||||
[Static]
|
[Static]
|
||||||
[Export ("calorieUnit")]
|
[Export ("calorieUnit")]
|
||||||
HKUnit Calorie { get; }
|
HKUnit Calorie { get; }
|
||||||
|
@ -1708,6 +1804,16 @@ namespace XamCore.HealthKit {
|
||||||
[Export ("kilocalorieUnit")]
|
[Export ("kilocalorieUnit")]
|
||||||
HKUnit Kilocalorie { get; }
|
HKUnit Kilocalorie { get; }
|
||||||
|
|
||||||
|
[Watch (4, 0), iOS (11, 0)]
|
||||||
|
[Static]
|
||||||
|
[Export ("smallCalorieUnit")]
|
||||||
|
HKUnit SmallCalorie { get; }
|
||||||
|
|
||||||
|
[Watch (4, 0), iOS (11, 0)]
|
||||||
|
[Static]
|
||||||
|
[Export ("largeCalorieUnit")]
|
||||||
|
HKUnit LargeCalorie { get; }
|
||||||
|
|
||||||
// HKUnit (Temperature) Category
|
// HKUnit (Temperature) Category
|
||||||
|
|
||||||
[Static]
|
[Static]
|
||||||
|
@ -1755,6 +1861,12 @@ namespace XamCore.HealthKit {
|
||||||
|
|
||||||
[Export ("reciprocalUnit")]
|
[Export ("reciprocalUnit")]
|
||||||
HKUnit ReciprocalUnit ();
|
HKUnit ReciprocalUnit ();
|
||||||
|
|
||||||
|
// HKUnit (Pharmacology) Category
|
||||||
|
[Watch (4, 0), iOS (11, 0)]
|
||||||
|
[Static]
|
||||||
|
[Export ("internationalUnit")]
|
||||||
|
HKUnit InternationalUnit { get; }
|
||||||
}
|
}
|
||||||
|
|
||||||
[Watch (2,0)]
|
[Watch (2,0)]
|
||||||
|
@ -1828,6 +1940,16 @@ namespace XamCore.HealthKit {
|
||||||
[Wrap ("Create (workoutActivityType, startDate, endDate, workoutEvents, totalEnergyBurned, totalDistance, totalSwimmingStrokeCount, device, metadata == null ? null : metadata.Dictionary)")]
|
[Wrap ("Create (workoutActivityType, startDate, endDate, workoutEvents, totalEnergyBurned, totalDistance, totalSwimmingStrokeCount, device, metadata == null ? null : metadata.Dictionary)")]
|
||||||
HKWorkout Create (HKWorkoutActivityType workoutActivityType, NSDate startDate, NSDate endDate, HKWorkoutEvent[] workoutEvents, HKQuantity totalEnergyBurned, HKQuantity totalDistance, HKQuantity totalSwimmingStrokeCount, HKDevice device, HKMetadata metadata);
|
HKWorkout Create (HKWorkoutActivityType workoutActivityType, NSDate startDate, NSDate endDate, HKWorkoutEvent[] workoutEvents, HKQuantity totalEnergyBurned, HKQuantity totalDistance, HKQuantity totalSwimmingStrokeCount, HKDevice device, HKMetadata metadata);
|
||||||
|
|
||||||
|
[Watch (4, 0), iOS (11, 0)]
|
||||||
|
[Static]
|
||||||
|
[Export ("workoutWithActivityType:startDate:endDate:workoutEvents:totalEnergyBurned:totalDistance:totalFlightsClimbed:device:metadata:")]
|
||||||
|
HKWorkout CreateFlightsClimbedWorkout (HKWorkoutActivityType workoutActivityType, NSDate startDate, NSDate endDate, [NullAllowed] HKWorkoutEvent [] workoutEvents, [NullAllowed] HKQuantity totalEnergyBurned, [NullAllowed] HKQuantity totalDistance, [NullAllowed] HKQuantity totalFlightsClimbed, [NullAllowed] HKDevice device, [NullAllowed] NSDictionary metadata);
|
||||||
|
|
||||||
|
[Watch (4, 0), iOS (11, 0)]
|
||||||
|
[Static]
|
||||||
|
[Wrap ("CreateFlightsClimbedWorkout (workoutActivityType, startDate, endDate, workoutEvents, totalEnergyBurned, totalDistance, totalFlightsClimbed, device, metadata == null ? null : metadata.Dictionary)")]
|
||||||
|
HKWorkout CreateFlightsClimbedWorkout (HKWorkoutActivityType workoutActivityType, NSDate startDate, NSDate endDate, [NullAllowed] HKWorkoutEvent [] workoutEvents, [NullAllowed] HKQuantity totalEnergyBurned, [NullAllowed] HKQuantity totalDistance, [NullAllowed] HKQuantity totalFlightsClimbed, [NullAllowed] HKDevice device, [NullAllowed] HKMetadata metadata);
|
||||||
|
|
||||||
// TODO: where is this thing used?
|
// TODO: where is this thing used?
|
||||||
[Field ("HKWorkoutSortIdentifierDuration")]
|
[Field ("HKWorkoutSortIdentifierDuration")]
|
||||||
NSString SortIdentifierDuration { get; }
|
NSString SortIdentifierDuration { get; }
|
||||||
|
@ -1843,6 +1965,14 @@ namespace XamCore.HealthKit {
|
||||||
[Watch (3,0), iOS (10,0)]
|
[Watch (3,0), iOS (10,0)]
|
||||||
[Field ("HKWorkoutSortIdentifierTotalSwimmingStrokeCount")]
|
[Field ("HKWorkoutSortIdentifierTotalSwimmingStrokeCount")]
|
||||||
NSString SortIdentifierTotalSwimmingStrokeCount { get; }
|
NSString SortIdentifierTotalSwimmingStrokeCount { get; }
|
||||||
|
|
||||||
|
[Watch (4, 0), iOS (11, 0)]
|
||||||
|
[Field ("HKWorkoutSortIdentifierTotalFlightsClimbed")]
|
||||||
|
NSString SortIdentifierTotalFlightsClimbed { get; }
|
||||||
|
|
||||||
|
[Watch (4, 0), iOS (11, 0)]
|
||||||
|
[NullAllowed, Export ("totalFlightsClimbed", ArgumentSemantic.Strong)]
|
||||||
|
HKQuantity TotalFlightsClimbed { get; }
|
||||||
}
|
}
|
||||||
|
|
||||||
[Watch (2,0)]
|
[Watch (2,0)]
|
||||||
|
@ -1853,6 +1983,7 @@ namespace XamCore.HealthKit {
|
||||||
[Export ("type")]
|
[Export ("type")]
|
||||||
HKWorkoutEventType Type { get; }
|
HKWorkoutEventType Type { get; }
|
||||||
|
|
||||||
|
[Availability (Deprecated = Platform.iOS_11_0 | Watch_4_0, Message = "Use 'DateInterval' instead.")]
|
||||||
[Export ("date", ArgumentSemantic.Copy)]
|
[Export ("date", ArgumentSemantic.Copy)]
|
||||||
NSDate Date { get; }
|
NSDate Date { get; }
|
||||||
|
|
||||||
|
@ -1864,19 +1995,34 @@ namespace XamCore.HealthKit {
|
||||||
[Wrap ("WeakMetadata")]
|
[Wrap ("WeakMetadata")]
|
||||||
HKMetadata Metadata { get; }
|
HKMetadata Metadata { get; }
|
||||||
|
|
||||||
|
[Availability (Deprecated = Platform.iOS_11_0 | Platform.Watch_4_0, Message = "Use 'Create (HKWorkoutEventType, NSDateInterval, HKMetadata)' instead.")]
|
||||||
[Static, Export ("workoutEventWithType:date:")]
|
[Static, Export ("workoutEventWithType:date:")]
|
||||||
HKWorkoutEvent Create (HKWorkoutEventType type, NSDate date);
|
HKWorkoutEvent Create (HKWorkoutEventType type, NSDate date);
|
||||||
|
|
||||||
[Watch (3,0), iOS (10,0)]
|
[Availability (Introduced = Platform.iOS_10_0 | Platform.Watch_3_0, Deprecated = Platform.iOS_11_0 | Platform.Watch_4_0, Message = "Use 'Create (HKWorkoutEventType, NSDateInterval, HKMetadata)' instead.")]
|
||||||
[Static]
|
[Static]
|
||||||
[EditorBrowsable (EditorBrowsableState.Advanced)] // this is not the one we want to be seen (compat only)
|
[EditorBrowsable (EditorBrowsableState.Advanced)] // this is not the one we want to be seen (compat only)
|
||||||
[Export ("workoutEventWithType:date:metadata:")]
|
[Export ("workoutEventWithType:date:metadata:")]
|
||||||
HKWorkoutEvent Create (HKWorkoutEventType type, NSDate date, NSDictionary metadata);
|
HKWorkoutEvent Create (HKWorkoutEventType type, NSDate date, NSDictionary metadata);
|
||||||
|
|
||||||
[Watch (3,0), iOS (10,0)]
|
[Availability (Introduced = Platform.iOS_10_0 | Platform.Watch_3_0, Deprecated = Platform.iOS_11_0 | Platform.Watch_4_0, Message = "Use 'Create (HKWorkoutEventType, NSDateInterval, HKMetadata)' instead.")]
|
||||||
[Static]
|
[Static]
|
||||||
[Wrap ("Create (type, date, metadata != null ? metadata.Dictionary : null)")]
|
[Wrap ("Create (type, date, metadata != null ? metadata.Dictionary : null)")]
|
||||||
HKWorkoutEvent Create (HKWorkoutEventType type, NSDate date, HKMetadata metadata);
|
HKWorkoutEvent Create (HKWorkoutEventType type, NSDate date, HKMetadata metadata);
|
||||||
|
|
||||||
|
[Watch (4, 0), iOS (11, 0)]
|
||||||
|
[Static]
|
||||||
|
[Export ("workoutEventWithType:dateInterval:metadata:")]
|
||||||
|
HKWorkoutEvent Create (HKWorkoutEventType type, NSDateInterval dateInterval, [NullAllowed] NSDictionary metadata);
|
||||||
|
|
||||||
|
[Watch (4, 0), iOS (11, 0)]
|
||||||
|
[Static]
|
||||||
|
[Wrap ("Create (type, dateInterval, metadata != null ? metadata.Dictionary : null)")]
|
||||||
|
HKWorkoutEvent Create (HKWorkoutEventType type, NSDateInterval dateInterval, HKMetadata metadata);
|
||||||
|
|
||||||
|
[Watch (4, 0), iOS (11, 0)]
|
||||||
|
[Export ("dateInterval", ArgumentSemantic.Copy)]
|
||||||
|
NSDateInterval DateInterval { get; }
|
||||||
}
|
}
|
||||||
|
|
||||||
[Watch (2,0)]
|
[Watch (2,0)]
|
||||||
|
@ -1895,6 +2041,14 @@ namespace XamCore.HealthKit {
|
||||||
interface HKDeletedObject : NSSecureCoding {
|
interface HKDeletedObject : NSSecureCoding {
|
||||||
[Export ("UUID", ArgumentSemantic.Strong)]
|
[Export ("UUID", ArgumentSemantic.Strong)]
|
||||||
NSUuid Uuid { get; }
|
NSUuid Uuid { get; }
|
||||||
|
|
||||||
|
[Watch (4, 0), iOS (11, 0)]
|
||||||
|
[NullAllowed, Export ("metadata", ArgumentSemantic.Copy)]
|
||||||
|
NSDictionary WeakMetadata { get; }
|
||||||
|
|
||||||
|
[Watch (4, 0), iOS (11, 0)]
|
||||||
|
[Wrap ("WeakMetadata")]
|
||||||
|
HKMetadata Metadata { get; }
|
||||||
}
|
}
|
||||||
|
|
||||||
[Watch (2,0)]
|
[Watch (2,0)]
|
||||||
|
@ -2010,6 +2164,32 @@ namespace XamCore.HealthKit {
|
||||||
|
|
||||||
[Export ("initWithSource:version:")]
|
[Export ("initWithSource:version:")]
|
||||||
IntPtr Constructor (HKSource source, [NullAllowed] string version);
|
IntPtr Constructor (HKSource source, [NullAllowed] string version);
|
||||||
|
|
||||||
|
[Watch (4, 0), iOS (11, 0)]
|
||||||
|
[NullAllowed, Export ("productType")]
|
||||||
|
string ProductType { get; }
|
||||||
|
|
||||||
|
[Watch (4, 0), iOS (11, 0)]
|
||||||
|
[Export ("operatingSystemVersion", ArgumentSemantic.Assign)]
|
||||||
|
NSOperatingSystemVersion OperatingSystemVersion { get; }
|
||||||
|
|
||||||
|
[Watch (4, 0), iOS (11, 0)]
|
||||||
|
[Export ("initWithSource:version:productType:operatingSystemVersion:")]
|
||||||
|
IntPtr Constructor (HKSource source, [NullAllowed] string version, [NullAllowed] string productType, NSOperatingSystemVersion operatingSystemVersion);
|
||||||
|
}
|
||||||
|
|
||||||
|
interface HKSourceRevisionInfo {
|
||||||
|
[Watch (4, 0), iOS (11, 0)]
|
||||||
|
[Field ("HKSourceRevisionAnyVersion")]
|
||||||
|
NSString AnyVersion { get; }
|
||||||
|
|
||||||
|
[Watch (4, 0), iOS (11, 0)]
|
||||||
|
[Field ("HKSourceRevisionAnyProductType")]
|
||||||
|
NSString AnyProductType { get; }
|
||||||
|
|
||||||
|
[Watch (4, 0), iOS (11, 0)]
|
||||||
|
[Export ("HKSourceRevisionAnyOperatingSystem")]
|
||||||
|
NSOperatingSystemVersion AnyOperatingSystem { get; }
|
||||||
}
|
}
|
||||||
|
|
||||||
[Watch (2,0)]
|
[Watch (2,0)]
|
||||||
|
@ -2142,4 +2322,62 @@ namespace XamCore.HealthKit {
|
||||||
[NullAllowed, Export ("lapLength", ArgumentSemantic.Copy)]
|
[NullAllowed, Export ("lapLength", ArgumentSemantic.Copy)]
|
||||||
HKQuantity LapLength { get; set; }
|
HKQuantity LapLength { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Watch (4, 0), iOS (11, 0)]
|
||||||
|
[BaseType (typeof (HKSampleType))]
|
||||||
|
[DisableDefaultCtor]
|
||||||
|
interface HKSeriesType {
|
||||||
|
[Static]
|
||||||
|
[Export ("workoutRouteType")]
|
||||||
|
HKSeriesType WorkoutRouteType { get; }
|
||||||
|
}
|
||||||
|
|
||||||
|
[BaseType (typeof (NSObject))]
|
||||||
|
[DisableDefaultCtor]
|
||||||
|
interface HKSeriesBuilder {
|
||||||
|
[Export ("discard")]
|
||||||
|
void Discard ();
|
||||||
|
}
|
||||||
|
|
||||||
|
[BaseType (typeof(HKSample))]
|
||||||
|
[DisableDefaultCtor]
|
||||||
|
interface HKSeriesSample : NSCopying {
|
||||||
|
[Export ("count")]
|
||||||
|
nuint Count { get; }
|
||||||
|
}
|
||||||
|
|
||||||
|
[BaseType (typeof(HKSeriesSample))]
|
||||||
|
[DisableDefaultCtor]
|
||||||
|
interface HKWorkoutRoute : NSCopying {
|
||||||
|
[Watch (4, 0), iOS (11, 0)]
|
||||||
|
[Field ("HKWorkoutRouteTypeIdentifier")]
|
||||||
|
NSString TypeIdentifier { get; }
|
||||||
|
}
|
||||||
|
|
||||||
|
[Watch (4, 0), iOS (11, 0)]
|
||||||
|
[BaseType (typeof (HKSeriesBuilder))]
|
||||||
|
[DisableDefaultCtor]
|
||||||
|
interface HKWorkoutRouteBuilder {
|
||||||
|
[Export ("initWithHealthStore:device:")]
|
||||||
|
[DesignatedInitializer]
|
||||||
|
IntPtr Constructor (HKHealthStore healthStore, [NullAllowed] HKDevice device);
|
||||||
|
|
||||||
|
[Async, Export ("insertRouteData:completion:")]
|
||||||
|
void InsertRouteData (CLLocation [] routeData, Action<bool, NSError> completion);
|
||||||
|
|
||||||
|
[Async, Protected, Export ("finishRouteWithWorkout:metadata:completion:")]
|
||||||
|
void FinishRoute (HKWorkout workout, [NullAllowed] NSDictionary metadata, Action<HKWorkoutRoute, NSError> completion);
|
||||||
|
|
||||||
|
[Async, Wrap ("FinishRoute (workout, metadata != null ? metadata.Dictionary : null, completion)")]
|
||||||
|
void FinishRoute (HKWorkout workout, HKMetadata metadata, Action<HKWorkoutRoute, NSError> completion);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Watch (4,0), iOS (11,0)]
|
||||||
|
[BaseType (typeof(HKQuery))]
|
||||||
|
interface HKWorkoutRouteQuery {
|
||||||
|
[Export ("initWithRoute:dataHandler:")]
|
||||||
|
[DesignatedInitializer]
|
||||||
|
IntPtr Constructor (HKWorkoutRoute workoutRoute, HKWorkoutRouteBuilderDataHandler dataHandler);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -88,6 +88,7 @@ namespace Introspection
|
||||||
"Anglet",
|
"Anglet",
|
||||||
"Arraycollation",
|
"Arraycollation",
|
||||||
"Argb",
|
"Argb",
|
||||||
|
"Asal",
|
||||||
"Asin",
|
"Asin",
|
||||||
"Atan",
|
"Atan",
|
||||||
"Ats", // App Transport Security
|
"Ats", // App Transport Security
|
||||||
|
@ -303,8 +304,10 @@ namespace Introspection
|
||||||
"Ocurrences",
|
"Ocurrences",
|
||||||
"Octree",
|
"Octree",
|
||||||
"Oid",
|
"Oid",
|
||||||
|
"Olus",
|
||||||
"Oneup", // TVElementKeyOneupTemplate
|
"Oneup", // TVElementKeyOneupTemplate
|
||||||
"Orthographyrange",
|
"Orthographyrange",
|
||||||
|
"Ostprandial",
|
||||||
"ove",
|
"ove",
|
||||||
"Paeth", // PNG filter
|
"Paeth", // PNG filter
|
||||||
"Parms", // short for Parameters
|
"Parms", // short for Parameters
|
||||||
|
@ -339,6 +342,7 @@ namespace Introspection
|
||||||
"Reacquirer",
|
"Reacquirer",
|
||||||
"Reinvitation",
|
"Reinvitation",
|
||||||
"Reinvite",
|
"Reinvite",
|
||||||
|
"Reprandial",
|
||||||
"Replayable",
|
"Replayable",
|
||||||
"Requestwith",
|
"Requestwith",
|
||||||
"Ridesharing",
|
"Ridesharing",
|
||||||
|
@ -358,6 +362,7 @@ namespace Introspection
|
||||||
"Scn",
|
"Scn",
|
||||||
"Sdk",
|
"Sdk",
|
||||||
"Sdtv", // acronym: Standard Definition Tele Vision
|
"Sdtv", // acronym: Standard Definition Tele Vision
|
||||||
|
"Sdnn",
|
||||||
"Seekable",
|
"Seekable",
|
||||||
"Shadable",
|
"Shadable",
|
||||||
"Sharegroup",
|
"Sharegroup",
|
||||||
|
|
|
@ -214,6 +214,10 @@ namespace Introspection {
|
||||||
case "FPUIActionExtensionContext": // Conformance not in headers
|
case "FPUIActionExtensionContext": // Conformance not in headers
|
||||||
case "UIDocumentBrowserAction": // Conformance not in headers
|
case "UIDocumentBrowserAction": // Conformance not in headers
|
||||||
return true;
|
return true;
|
||||||
|
// Header shows implementing NSSecureCoding, but supportsSecureCoding returns false. Radar #34800025
|
||||||
|
case "HKSeriesBuilder":
|
||||||
|
case "HKWorkoutRouteBuilder":
|
||||||
|
return true;
|
||||||
#if __WATCHOS__
|
#if __WATCHOS__
|
||||||
case "CLKComplicationTemplate":
|
case "CLKComplicationTemplate":
|
||||||
case "CLKComplicationTemplateCircularSmallRingImage":
|
case "CLKComplicationTemplateCircularSmallRingImage":
|
||||||
|
@ -355,6 +359,10 @@ namespace Introspection {
|
||||||
case "FPUIActionExtensionContext": // Conformance not in headers
|
case "FPUIActionExtensionContext": // Conformance not in headers
|
||||||
case "UIDocumentBrowserAction": // Conformance not in headers
|
case "UIDocumentBrowserAction": // Conformance not in headers
|
||||||
return true;
|
return true;
|
||||||
|
// Header shows implementing NSSecureCoding, but supportsSecureCoding returns false. Radar #34800025
|
||||||
|
case "HKSeriesBuilder":
|
||||||
|
case "HKWorkoutRouteBuilder":
|
||||||
|
return true;
|
||||||
#if __WATCHOS__
|
#if __WATCHOS__
|
||||||
case "CLKComplicationTemplate":
|
case "CLKComplicationTemplate":
|
||||||
case "CLKComplicationTemplateCircularSmallRingImage":
|
case "CLKComplicationTemplateCircularSmallRingImage":
|
||||||
|
|
|
@ -54,6 +54,11 @@ namespace MonoTouchFixtures.HealthKit {
|
||||||
if (!TestRuntime.CheckXcodeVersion (8, 0))
|
if (!TestRuntime.CheckXcodeVersion (8, 0))
|
||||||
continue;
|
continue;
|
||||||
break;
|
break;
|
||||||
|
case HKQuantityTypeIdentifier.WaistCircumference:
|
||||||
|
case HKQuantityTypeIdentifier.VO2Max:
|
||||||
|
if (!TestRuntime.CheckXcodeVersion(9, 0))
|
||||||
|
continue;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
Загрузка…
Ссылка в новой задаче