<!--
{
  "availability" : [
    "iOS: 16.2.0 -",
    "iPadOS: 16.2.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "ActivityKit",
  "identifier" : "/documentation/ActivityKit/ActivityAttributes/previewContext(_:isStale:viewKind:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "ActivityKit"
    ],
    "preciseIdentifier" : "s:11ActivityKit0A10AttributesP06WidgetB0E14previewContext_7isStale8viewKindQr12ContentStateQz_SbAD0a11PreviewViewJ0OtF"
  },
  "title" : "previewContext(_:isStale:viewKind:)"
}
-->

# previewContext(_:isStale:viewKind:)

Generates a preview for a Live Activity.

```
func previewContext(_ contentState: Self.ContentState, isStale: Bool = false, viewKind: ActivityPreviewViewKind) -> some View
```

## Parameters

`contentState`

The dynamic content of the Live Activity.

`isStale`

A Boolean that indicates whether the content of a Live Activity is out of date.

`viewKind`

A value that determines which Live Activity presentation to render for this preview.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)