---
title: "getTimeline(in:completion:)"
framework: widgetkit
role: symbol
role_heading: Instance Method
path: "widgetkit/timelineprovider/gettimeline(in:completion:)"
---

# getTimeline(in:completion:)

Provides an array of timeline entries for the current time and, optionally, any future times to update a widget.

## Declaration

```swift
@preconcurrency func getTimeline(in context: Self.Context, completion: @escaping @Sendable (Timeline<Self.Entry>) -> Void)
```

## Parameters

- `context`: An object describing the context to show the widget in.
- `completion`: The completion handler to call after you create the timeline.

## Mentioned in

Migrating ClockKit complications to WidgetKit Making network requests in a widget extension

## See Also

### Generating Timelines

- [getSnapshot(in:completion:)](widgetkit/timelineprovider/getsnapshot(in:completion:).md)
- [placeholder(in:)](widgetkit/timelineprovider/placeholder(in:).md)
- [Entry](widgetkit/timelineprovider/entry.md)
- [TimelineProvider.Context](widgetkit/timelineprovider/context.md)
