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

# level(forRow:)

Returns the indentation level for a given row.

```
func level(forRow row: Int) -> Int
```

## Parameters

`row`

The index of a row in the receiver.

## Return Value

The indentation level for `row`. For an invalid row, returns `–1`.

## Discussion

The levels are zero-based—that is, the first level of displayed items is level `0`.

---

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)