<!--
{
  "availability" : [
    "watchOS: 6.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/WKHostingController/updateBodyIfNeeded()",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI19WKHostingControllerC18updateBodyIfNeededyyF"
  },
  "title" : "updateBodyIfNeeded()"
}
-->

# updateBodyIfNeeded()

Updates the interface controller’s set of views immediately, if updates
are pending.

```
@MainActor @preconcurrency func updateBodyIfNeeded()
```

## Discussion

Calling this method forces the hosting controller to update its current
set of views, but only if there are pending changes. If there are no
pending changes, this method does nothing.

To mark the interface controller as needing an update, call
[`setNeedsBodyUpdate()`](/documentation/SwiftUI/WKHostingController/setNeedsBodyUpdate()).

---

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)