---
title: "selectNextKeyView(_:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nswindow/selectnextkeyview(_:)"
---

# selectNextKeyView(_:)

Searches for a candidate next key view and, if it finds one, tries to make it the first responder.

## Declaration

```swift
func selectNextKeyView(_ sender: Any?)
```

## Parameters

- `sender`: The message’s sender.

## Discussion

Discussion The candidate is one of the following (which this function searches for in this order): The current first responder’s next valid key view, which the nextValidKeyView method of NSView returns The object initialFirstResponder designates as the window’s initial first responder if it returns true to an acceptsFirstResponder message Otherwise, the initial first responder’s next valid key view, which may be nil

## See Also

### Managing the Key View Loop

- [selectKeyView(preceding:)](appkit/nswindow/selectkeyview(preceding:).md)
- [selectKeyView(following:)](appkit/nswindow/selectkeyview(following:).md)
- [selectPreviousKeyView(_:)](appkit/nswindow/selectpreviouskeyview(_:).md)
- [keyViewSelectionDirection](appkit/nswindow/keyviewselectiondirection.md)
- [autorecalculatesKeyViewLoop](appkit/nswindow/autorecalculateskeyviewloop.md)
- [recalculateKeyViewLoop()](appkit/nswindow/recalculatekeyviewloop().md)
