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

# validateProposedFirstResponder(_:for:)

Allows controls to determine when they should become first responder.

```
func validateProposedFirstResponder(_ responder: NSResponder, for event: NSEvent?) -> Bool
```

## Parameters

`responder`

The first responder.

`event`

The event to validate. May be `nil` if there is no applicable event.

## Return Value

<doc://com.apple.documentation/documentation/Swift/true> if the control should become first responder, otherwise <doc://com.apple.documentation/documentation/Swift/false>.

## Discussion

Some controls, such as `NSTextField`, should only become first responder when the enclosing NSTableView/NSBrowser indicates that the view can begin editing. It is up to the particular control that wants to be validated to call this method in its [`mouseDown(with:)`](/documentation/AppKit/NSResponder/mouseDown(with:)) method (or perhaps at another time) to determine if it should attempt to become the first responder or not.

The [`NSTableView`](/documentation/AppKit/NSTableView), [`NSOutlineView`](/documentation/AppKit/NSOutlineView), and [`NSBrowser`](/documentation/AppKit/NSBrowser) classes implement this to allow first responder status only if the responder is a view in a selected row. It also delays the first responder assignment if a `doubleAction` may be invoked.

The default implementation returns <doc://com.apple.documentation/documentation/Swift/true> when there is no [`nextResponder`](/documentation/AppKit/NSResponder/nextResponder) set, otherwise, it is forwarded up the responder chain.

---

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)