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

# firstResponder

The window’s first responder.

```
weak var firstResponder: NSResponder? { get }
```

## Discussion

The first responder is usually the first object in a responder chain to receive an event or action message. In most cases, the first responder is a view object that the user selects or activates with the mouse or keyboard.

You can use the [`firstResponder`](/documentation/AppKit/NSWindow/firstResponder) property in custom subclasses of responder classes ([`NSWindow`](/documentation/AppKit/NSWindow), [`NSApplication`](/documentation/AppKit/NSApplication), [`NSView`](/documentation/AppKit/NSView), and subclasses) to determine if an instance of the subclass is currently the first responder. You can also use it to help locate a text field that currently has first-responder status. For more information, see [Mouse, Keyboard, and Trackpad](/documentation/AppKit/mouse-keyboard-and-trackpad). This property is key-value observing compliant.

## See Also

[`acceptsFirstResponder`](/documentation/AppKit/NSResponder/acceptsFirstResponder)

A Boolean value that indicates whether the responder accepts first responder status.



---

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)