<!--
{
  "availability" : [
    "iOS: 8.0.0 - 14.0.0",
    "iPadOS: 8.0.0 - 14.0.0",
    "macCatalyst: 8.0.0 - 14.0.0",
    "macOS: 10.10.0 - 11.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "NotificationCenter",
  "identifier" : "/documentation/NotificationCenter/NCWidgetProviding/widgetPerformUpdate(completionHandler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Notification Center"
    ],
    "preciseIdentifier" : "c:objc(pl)NCWidgetProviding(im)widgetPerformUpdateWithCompletionHandler:"
  },
  "title" : "widgetPerformUpdate(completionHandler:)"
}
-->

# widgetPerformUpdate(completionHandler:)

Called to give a widget an opportunity to update its contents.

```
optional func widgetPerformUpdate(completionHandler: @escaping @Sendable (NCUpdateResult) -> Void)
```

## Parameters

`completionHandler`

A block to be called when the widget’s content has been updated.

    The block takes the following parameter:

- result: A value of type `NCUpdateResult` that describes the result of the update procedure. ([`NCUpdateResult`](/documentation/NotificationCenter/NCUpdateResult) lists the possible values of `result`.)

## Discussion

> Important:
> You can call this method from synchronous code using a completion handler, as shown on this page, or you can call it as an asynchronous method that has the following declaration:
> 
> ```swift
> optional func widgetPerformUpdate() async -> NCUpdateResult
> ```
> 
> For information about concurrency and asynchronous code in Swift, see <doc://com.apple.documentation/documentation/Swift/calling-objective-c-apis-asynchronously>.

This method is called to give a widget an opportunity to update its contents and redraw its view prior to an operation such as a snapshot. When the widget is finished updating its contents (and redrawing, if necessary), the widget should call the completion handler block, passing the appropriate `NCUpdateResult` value.

---

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)