---
title: "validateProposedFirstResponder(_:for:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nsresponder/validateproposedfirstresponder(_:for:)"
---

# validateProposedFirstResponder(_:for:)

Allows controls to determine when they should become first responder.

## Declaration

```swift
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

Return Value true if the control should become first responder, otherwise false.

## Discussion

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:) method (or perhaps at another time) to determine if it should attempt to become the first responder or not. The NSTableView, NSOutlineView, and 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 true when there is no nextResponder set, otherwise, it is forwarded up the responder chain.

## See Also

### Changing the First Responder

- [acceptsFirstResponder](appkit/nsresponder/acceptsfirstresponder.md)
- [becomeFirstResponder()](appkit/nsresponder/becomefirstresponder().md)
- [resignFirstResponder()](appkit/nsresponder/resignfirstresponder().md)
