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

# standardWindowButton(_:)

Returns the window button of a given window button kind in the window’s view hierarchy.

```
func standardWindowButton(_ b: NSWindow.ButtonType) -> NSButton?
```

## Parameters

`b`

The type of standard window button to return.

## Return Value

Window button in the window’s view hierarchy of the type identified by `b`; `nil` when such button is not in the window’s view hierarchy.

## Discussion

---

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)