iOS Guides | Samples

MonoTouch.HealthKitUI Namespace

The HealthKitUI provides the HKActivityRingView that provides HealthKit information.

Remarks

Developers can set the values within the HKActivityRingView using a HKActivitySummary object, as shown in the following example:

C# Example

var view = new HKActivityRingView (new CGRect (10, 10, 200, 200));

var summary = new HKActivitySummary ();
//Outer ring (Red)
summary.ActiveEnergyBurnedGoal = HKQuantity.FromQuantity (HKUnit.Kilocalorie, 200.0);
summary.ActiveEnergyBurned = HKQuantity.FromQuantity (HKUnit.Kilocalorie, 150.0);

//Middle ring (Green)
summary.AppleExerciseTime = HKQuantity.FromQuantity (HKUnit.Hour, 0.5);
summary.AppleExerciseTimeGoal = HKQuantity.FromQuantity (HKUnit.Hour, 1.0);

//Inner ring (Blue)
summary.AppleStandHours = HKQuantity.FromQuantity (HKUnit.Count, 2);
summary.AppleStandHoursGoal = HKQuantity.FromQuantity (HKUnit.Count, 8);

Classes

TypeReason
HKActivityRingViewA UIView that shows the data in a HKSummary.
HKActivityRingView+HKActivityRingViewAppearanceAppearance class for objects of type HKActivityRingView.