<!--
{
  "availability" : [
    "iOS: 14.0.0 -",
    "iPadOS: 14.0.0 -",
    "macCatalyst: -",
    "macOS: 11.0.0 -",
    "visionOS: 26.0.0 -",
    "watchOS: 9.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "WidgetKit",
  "identifier" : "/documentation/WidgetKit/TimelineProvider/getTimeline(in:completion:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "WidgetKit"
    ],
    "preciseIdentifier" : "s:9WidgetKit16TimelineProviderP03getC02in10completionyAA0cD7ContextV_yAA0C0Vy5EntryQzGctF"
  },
  "title" : "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.

```
@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.

---

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)