---
title: updateWindows()
framework: appkit
role: symbol
role_heading: Instance Method
path: appkit/nsapplication/updatewindows()
---

# updateWindows()

Sends an update() message to each onscreen window.

## Declaration

```swift
func updateWindows()
```

## Discussion

Discussion This method is invoked automatically in the main event loop after each event when running in NSDefaultRunLoopMode or NSModalRunLoopMode. This method is not invoked automatically when running in NSEventTrackingRunLoopMode. When this method begins, it posts an willUpdateNotification to the default notification center. When it successfully completes, it posts an didUpdateNotification.

## See Also

### Related Documentation

- [applicationDidUpdate(_:)](appkit/nsapplicationdelegate/applicationdidupdate(_:).md)
- [applicationWillUpdate(_:)](appkit/nsapplicationdelegate/applicationwillupdate(_:).md)
- [update()](appkit/nswindow/update().md)

### Updating Windows

- [setWindowsNeedUpdate(_:)](appkit/nsapplication/setwindowsneedupdate(_:).md)
