Class

HKActivitySummary

An object that contains the move, exercise, and stand data for a given day.

Overview

You can read HKActivitySummary objects from the HealthKit store using an HKActivitySummaryQuery object. Unlike the HKSample subclasses, HKActivitySummary instances are mutable, but changes made to the object’s properties have no affect on the values in the HealthKit store.

You can instantiate your own HKActivitySummary objects (if needed), but you cannot save HKActivitySummary objects to the store.

You can display an active summary in iOS using the HKActivityRingView class or on watchOS using the WKInterfaceActivityRing class.

Topics

Accessing the Summary’s Data

var activeEnergyBurned: HKQuantity

The amount of active energy that the user has burned during the specified day.

var activeEnergyBurnedGoal: HKQuantity

The user’s daily goal for active energy burned.

var appleExerciseTime: HKQuantity

The amount of time that the user has spent exercising during the specified day.

var appleExerciseTimeGoal: HKQuantity

The user’s daily exercise goal.

var appleStandHours: HKQuantity

The number of stand hours that the user has earned during the specified day.

var appleStandHoursGoal: HKQuantity

The user’s daily goal for stand hours.

enum HKCategoryValueAppleStandHour

Categories used to indicate whether the user stood during the sample’s duration.

func dateComponents(for: Calendar) -> DateComponents

Date components that uniquely identify the day represented by the summary object.

Predicate Key Paths

let HKPredicateKeyPathDateComponents: String

A key path for an activity summary’s date components.

Relationships

Inherits From

See Also

Activity Rings

class HKActivitySummaryQuery

A query for read activity summary objects from the HealthKit store.

class HKActivityRingView

A view that uses the Move, Exercise, and Stand activity rings to display data from a HealthKit activity summary object.