---
title: "snapshot(for:in:)"
framework: widgetkit
role: symbol
role_heading: Instance Method
path: "widgetkit/appintenttimelineprovider/snapshot(for:in:)"
---

# snapshot(for:in:)

Provides a timeline entry representing the current time and state of a widget.

## Declaration

```swift
func snapshot(for configuration: Self.Intent, in context: Self.Context) async -> Self.Entry
```

## Parameters

- `configuration`: The intent containing user-customized values.
- `context`: An object describing the context to show the widget in.

## Return Value

Return Value A timeline entry representing the current time and state of a widget

## Discussion

Discussion WidgetKit calls snapshot(for:in:) when the widget appears in transient situations. If context.isPreview is true, the widget appears in the widget gallery. In that case, return the Entry as quickly as possible, perhaps supplying sample data if it could take more than a few seconds to fetch or calculate the widget’s current state. The configuration parameter provides user-customized values, as defined in your custom intent.

## See Also

### Generating timelines

- [placeholder(in:)](widgetkit/appintenttimelineprovider/placeholder(in:).md)
- [recommendations()](widgetkit/appintenttimelineprovider/recommendations().md)
- [relevance()](widgetkit/appintenttimelineprovider/relevance().md)
- [timeline(for:in:)](widgetkit/appintenttimelineprovider/timeline(for:in:).md)
- [AppIntentTimelineProvider.Context](widgetkit/appintenttimelineprovider/context.md)
- [Entry](widgetkit/appintenttimelineprovider/entry.md)
- [Intent](widgetkit/appintenttimelineprovider/intent.md)
