---
title: HKActivityRingView
framework: healthkitui
role: symbol
role_heading: Class
path: healthkitui/hkactivityringview
---

# HKActivityRingView

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

## Declaration

```swift
class HKActivityRingView
```

## Mentioned in

Executing Activity Summary Queries

## Overview

Overview Use HKActivityRingView to display data from an HKActivitySummary object. For example, the following image shows how the rings can display a summary view of a person’s activity.

To display activity summary data from the HealthKit store, use an HKActivitySummaryQuery object. You can also instantiate and display your own HKActivitySummary objects, as needed. The activity ring view always appears as a black rectangle with colored concentric rings. The rings are centered in the view and are sized to fit the available space.

The activity ring view displays different rings depending on the properties defined in the ring view’s HKActivitySummary property. When the view’s HKActivitySummary has activityMoveMode set to appleMoveTime and nil values for appleExerciseTimeGoal and appleStandHoursGoal the ring only displays the red Move ring. Otherwise, it displays the Move, Exercise, and Stand activity as red, green, and blue concentric rings. Summary data from the HealthKit store only displays the Move ring when the person hasn’t paired an Apple Watch. The rings can display as either empty or with a dot at the top of the ring to display a lack of data. Empty rings indicate that the activity summary is missing, and a dot at the top indicates that the activity summary’s values are set to zero. If the ring has a nil-valued activitySummary quantity properties, the rings appear empty. Use this to indicate that there is no summary data available for the specified day. For example, dates in the future.

If the summary has zero-valued quantities set for its value properties, the ring displays a dot at the top of the ring. Use this to indicate that the person hasn’t burned any active calories, exercised, or earned any stand hours for the specified day.

To display data for a ring, the HKActivitySummary object must have a non-nil quantity for both the corresponding value property and the goal property.  |  |   |  |   |  |   |  |  Move only ring properties:  |  |   |  |  The activity ring view colors a percentage of each ring based on these properties, as shown here: ring percent = value property quantity / goal property quantity

The following code snippet shows how to manually display only the Move ring: let moveOnlySummary = HKActivitySummary() moveOnlySummary.activityMoveMode = .appleMoveTime moveOnlySummary.appleMoveTime = HKQuantity(unit: .minute(), doubleValue: 60.0) moveOnlySummary.appleMoveTimeGoal = HKQuantity(unit: .minute(), doubleValue: 90.0)

## Topics

### Setting the activity summary

- [activitySummary](healthkitui/hkactivityringview/activitysummary.md)
- [setActivitySummary(_:animated:)](healthkitui/hkactivityringview/setactivitysummary(_:animated:).md)

## Relationships

### Inherits From

- [UIView](uikit/uiview.md)

### Conforms To

- [CALayerDelegate](quartzcore/calayerdelegate.md)
- [CLBodyIdentifiable](corelocation/clbodyidentifiable.md)
- [CMBodyIdentifiable](coremotion/cmbodyidentifiable.md)
- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSCoding](foundation/nscoding.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [NSTouchBarProvider](appkit/nstouchbarprovider.md)
- [UIAccessibilityIdentification](uikit/uiaccessibilityidentification.md)
- [UIActivityItemsConfigurationProviding](uikit/uiactivityitemsconfigurationproviding.md)
- [UIAppearance](uikit/uiappearance.md)
- [UIAppearanceContainer](uikit/uiappearancecontainer.md)
- [UICoordinateSpace](uikit/uicoordinatespace.md)
- [UIDynamicItem](uikit/uidynamicitem.md)
- [UIFocusEnvironment](uikit/uifocusenvironment.md)
- [UIFocusItem](uikit/uifocusitem.md)
- [UIFocusItemContainer](uikit/uifocusitemcontainer.md)
- [UILargeContentViewerItem](uikit/uilargecontentvieweritem.md)
- [UIPasteConfigurationSupporting](uikit/uipasteconfigurationsupporting.md)
- [UIPopoverPresentationControllerSourceItem](uikit/uipopoverpresentationcontrollersourceitem.md)
- [UIResponderStandardEditActions](uikit/uiresponderstandardeditactions.md)
- [UITraitChangeObservable](uikit/uitraitchangeobservable-67e94.md)
- [UITraitEnvironment](uikit/uitraitenvironment.md)
- [UIUserActivityRestoring](uikit/uiuseractivityrestoring.md)
