---
title: "selectKeyView(preceding:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nswindow/selectkeyview(preceding:)"
---

# selectKeyView(preceding:)

Gives key view status to the view that precedes the given view.

## Declaration

```swift
func selectKeyView(preceding view: NSView)
```

## Parameters

- `view`: The view whose preceding view in the key view loop to seek.

## Discussion

Discussion Sends the previousValidKeyView message to view and, if that message returns an NSView object, invokes makeFirstResponder(_:) with the returned object.

## See Also

### Managing the Key View Loop

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