---
title: DeviceActivityReport.Context
framework: deviceactivity
role: symbol
role_heading: Structure
path: deviceactivity/deviceactivityreport/context
---

# DeviceActivityReport.Context

A context indicating how your device activity report extension should configure its DeviceActivityReportView.

## Declaration

```swift
struct Context
```

## Overview

Overview You can use a DeviceActivityReport.Context to create a DeviceActivityReport, which the system then provides to your app’s extension and allows it to configure the resulting report View in a particular way. For example, if you want to render either a pie chart or bar graph representing the user’s device activity, you can create the following custom contexts: extension DeviceActivityReport.Context {     static let barGraph = Self("barGraph")     static let pieChart = Self("pieChart") } If your app instantiates a report with the barGraph context, then the system prompts your report extension to generate a view using the Scene corresponding to that context.

## Topics

### Initializers

- [init(_:)](deviceactivity/deviceactivityreport/context/init(_:).md)
- [init(rawValue:)](deviceactivity/deviceactivityreport/context/init(rawvalue:).md)

### Instance Properties

- [rawValue](deviceactivity/deviceactivityreport/context/rawvalue.md)

## Relationships

### Conforms To

- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [RawRepresentable](swift/rawrepresentable.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)
