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

# selectKeyView(preceding:)

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

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

## Parameters

`view`

The view whose preceding view in the key view loop to seek.

## Discussion

Sends the [`previousValidKeyView`](/documentation/AppKit/NSView/previousValidKeyView) message to `view` and, if that message returns an `NSView` object, invokes [`makeFirstResponder(_:)`](/documentation/AppKit/NSWindow/makeFirstResponder(_:)) with the returned object.

---

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)