<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSWindow/makeKeyAndOrderFront(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSWindow(im)makeKeyAndOrderFront:"
  },
  "title" : "makeKeyAndOrderFront(_:)"
}
-->

# makeKeyAndOrderFront(_:)

Moves the window to the front of the screen list, within its level, and makes it the key window; that is, it shows the window.

```
func makeKeyAndOrderFront(_ sender: Any?)
```

## Parameters

`sender`

The message’s sender.

## See Also

[`orderBack(_:)`](/documentation/AppKit/NSWindow/orderBack(_:))

Moves the window to the back of its level in the screen list, without changing either the key window or the main window.

[`orderFront(_:)`](/documentation/AppKit/NSWindow/orderFront(_:))

Moves the window to the front of its level in the screen list, without changing either the key window or the main window.

[`level`](/documentation/AppKit/NSWindow/level-swift.property)

The window level of the window.

[`order(_:relativeTo:)`](/documentation/AppKit/NSWindow/order(_:relativeTo:))

Repositions the window’s window device in the window server’s screen list.

[`orderOut(_:)`](/documentation/AppKit/NSWindow/orderOut(_:))

Removes the window from the screen list, which hides the window.



---

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)