---
title: "windowDidBecomeKey(_:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nswindowdelegate/windowdidbecomekey(_:)"
---

# windowDidBecomeKey(_:)

Tells the delegate that the window has become the key window.

## Declaration

```swift
@MainActor optional func windowDidBecomeKey(_ notification: Notification)
```

## Parameters

- `notification`: A notification named doc://com.apple.appkit/documentation/AppKit/NSWindow/didBecomeKeyNotification.

## Discussion

Discussion You can retrieve the window object in question by sending object to notification.

## See Also

### Managing Key Status

- [windowDidResignKey(_:)](appkit/nswindowdelegate/windowdidresignkey(_:).md)
