---
title: setNeedsBodyUpdate()
framework: swiftui
role: symbol
role_heading: Instance Method
path: swiftui/wkhostingcontroller/setneedsbodyupdate()
---

# setNeedsBodyUpdate()

Invalidates the current SwiftUI views and triggers an update during the next cycle.

## Declaration

```swift
@MainActor @preconcurrency func setNeedsBodyUpdate()
```

## Discussion

Discussion Call this method to mark the views of the hosting controller as needing an update. During the next update cycle, the hosting controller fetches an updated set of views from its body property.

## See Also

### Updating the root view

- [updateBodyIfNeeded()](swiftui/wkhostingcontroller/updatebodyifneeded().md)
