One Logo Pool Ball
_DeviceActivity_SwiftUI · IOS API REFERENCE

DeviceActivityReport.Context

struct · iOS 16.0+ · SDK 27.1

struct Context

A context indicating how your device activity report extension should configure its ``DeviceActivityReportView``. You can use a ``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.

Members (4)

init · iOS 16.0+

init

TypeScript
initRawValue(rawValue: string): Promise<DeviceActivityReport_Context>
Swift declaration
init(rawValue: String)

Creates a new instance with the specified raw value. - Parameters: - rawValue: The raw value to use for the new instance.

get · iOS 16.0+

rawValue

TypeScript
getRawValue($self: DeviceActivityReport_Context): Promise<string>
Swift declaration
var rawValue: String

The underlying value that represents the given context.

set · iOS 16.0+

rawValue

TypeScript
setRawValue($self: DeviceActivityReport_Context, value: string): Promise<void>
Swift declaration
var rawValue: String

The underlying value that represents the given context.

init · iOS 16.0+

init

TypeScript
init(rawValue: string): Promise<DeviceActivityReport_Context>
Swift declaration
init(_ rawValue: String)

Creates a new instance with the specified raw value. - Parameters: - rawValue: The raw value to use for the new instance.

Skipped declarations

No declarations were skipped in this snapshot.

All _DeviceActivity_SwiftUI types →