<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSBrowser",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSBrowser"
  },
  "title" : "NSBrowser"
}
-->

# NSBrowser

An interface that displays a hierarchically organized list of data items that can be navigated and selected.

```
class NSBrowser
```

## Overview

A browser displays information using a set of columns, which are indexed from left to right. Each successive column displays the next level down in the data hierarchy. This class uses the [`NSBrowserCell`](/documentation/AppKit/NSBrowserCell) class to implement its user interface.

Browsers have the following components:

- Columns
- Scroll views
- Matrices
- Browser cells

To the user, browsers display data in columns and rows within each column. These components are arranged in the following component hierarchy:

```objc
Browser
|---Columns [1..*]
    |---Scroll view
       |---Matrix
           |---Rows [0..*]
```

### Superclass overrides

- [`isOpaque`](/documentation/AppKit/NSView/isOpaque) returns <doc://com.apple.documentation/documentation/Swift/true> when the browser doesn’t have a title and its background color’s alpha component is `1.0`; otherwise, it returns <doc://com.apple.documentation/documentation/Swift/false>.

### Protocol implementations

- The [`NSBrowser`](/documentation/AppKit/NSBrowser) implementation of [`namesOfPromisedFilesDropped(atDestination:)`](/documentation/AppKit/NSDraggingInfo/namesOfPromisedFilesDropped(atDestination:)) provides the names of the files that the browser promises to create at a specified location, the result of sending `browser:namesOfPromisedFilesDroppedAtDestination:forDraggedRowsWithIndexes:inColumn:` to the delegate.

## Topics

### Configuring Browsers

[`reusesColumns`](/documentation/AppKit/NSBrowser/reusesColumns)

A Boolean that indicates whether the browser reuses matrix objects after their columns are unloaded.

[`maxVisibleColumns`](/documentation/AppKit/NSBrowser/maxVisibleColumns)

The maximum number of visible columns.

[`autohidesScroller`](/documentation/AppKit/NSBrowser/autohidesScroller)

A Boolean that indicates whether the browser automatically hides its scroller.

[`backgroundColor`](/documentation/AppKit/NSBrowser/backgroundColor)

The browser’s background color.

[`minColumnWidth`](/documentation/AppKit/NSBrowser/minColumnWidth)

The minimum column width, in pixels.

[`separatesColumns`](/documentation/AppKit/NSBrowser/separatesColumns)

A Boolean that indicates whether columns are separated by bezeled borders.

[`takesTitleFromPreviousColumn`](/documentation/AppKit/NSBrowser/takesTitleFromPreviousColumn)

A Boolean that indicates whether a column takes its title from the selected cell in the previous column.

[`-  tile`](/documentation/AppKit/NSBrowser/tile())

Adjusts the various subviews of the browser—scrollers, columns, titles, and so on—without redrawing.

[`delegate`](/documentation/AppKit/NSBrowser/delegate)

The browser’s delegate.

### Managing Component Types

[`cellClass`](/documentation/AppKit/NSBrowser/cellClass)

Returns the `NSBrowserCell` class.

[`-  setCellClass:`](/documentation/AppKit/NSBrowser/setCellClass(_:))

Sets the class of the cell to be used by the matrices in the columns of the browser.

[`cellPrototype`](/documentation/AppKit/NSBrowser/cellPrototype)

The prototype `NSCell` for displaying items in the matrices in the columns of the browser.

### Managing Selection Behavior

[`allowsBranchSelection`](/documentation/AppKit/NSBrowser/allowsBranchSelection)

A Boolean that indicates whether the user can select branch items.

[`allowsEmptySelection`](/documentation/AppKit/NSBrowser/allowsEmptySelection)

A Boolean that indicates whether there can be nothing selected.

[`allowsMultipleSelection`](/documentation/AppKit/NSBrowser/allowsMultipleSelection)

A Boolean that indicates whether the user can select multiple items.

[`-  selectedRowIndexesInColumn:`](/documentation/AppKit/NSBrowser/selectedRowIndexes(inColumn:))

Provides the indexes of the selected rows in a given column of the browser.

[`-  selectRowIndexes:inColumn:`](/documentation/AppKit/NSBrowser/selectRowIndexes(_:inColumn:))

Specifies the selected rows in a given column of the browser.

[`allowsTypeSelect`](/documentation/AppKit/NSBrowser/allowsTypeSelect)

A Boolean that indicates whether the browser allows keystroke-based selection (type select).

### Managing Selection

[`selectedCell`](/documentation/AppKit/NSBrowser/selectedCell)

The last (rightmost and lowest) selected cell.

[`-  selectedCellInColumn:`](/documentation/AppKit/NSBrowser/selectedCell(inColumn:))

Returns the last (lowest) cell selected in the given column.

[`selectedCells`](/documentation/AppKit/NSBrowser/selectedCells)

All cells selected in the rightmost column.

[`-  selectAll:`](/documentation/AppKit/NSBrowser/selectAll(_:))

Selects all cells in the last column of the browser.

[`-  selectedRowInColumn:`](/documentation/AppKit/NSBrowser/selectedRow(inColumn:))

Returns the row index of the selected cell in the specified column.

[`-  selectRow:inColumn:`](/documentation/AppKit/NSBrowser/selectRow(_:inColumn:))

Selects the cell at the specified row and column index.

[`selectionIndexPath`](/documentation/AppKit/NSBrowser/selectionIndexPath)

The index path of the item selected in the browser.

[`selectionIndexPaths`](/documentation/AppKit/NSBrowser/selectionIndexPaths)

An array containing the index paths of all items selected in the browser.

### Accessing Components

[`-  loadedCellAtRow:column:`](/documentation/AppKit/NSBrowser/loadedCell(atRow:column:))

Loads, if necessary, and returns the cell at the specified row and column location.

[`-  editItemAtIndexPath:withEvent:select:`](/documentation/AppKit/NSBrowser/editItem(at:with:select:))

Begins editing the item at the specified path.

[`-  itemAtIndexPath:`](/documentation/AppKit/NSBrowser/item(at:))

Returns the item at the specified index path.

[`-  itemAtRow:inColumn:`](/documentation/AppKit/NSBrowser/item(atRow:inColumn:))

Returns the item located at the specified row and column.

[`-  indexPathForColumn:`](/documentation/AppKit/NSBrowser/indexPath(forColumn:))

Returns the index path of the item whose children are displayed in the given column.

[`-  isLeafItem:`](/documentation/AppKit/NSBrowser/isLeafItem(_:))

Returns whether the specified item is a leaf item.

[`-  parentForItemsInColumn:`](/documentation/AppKit/NSBrowser/parentForItems(inColumn:))

Returns the item that contains the children located in the specified column.

### Managing the Path

[`-  path`](/documentation/AppKit/NSBrowser/path())

Returns a string representing the browser’s current path.

[`-  setPath:`](/documentation/AppKit/NSBrowser/setPath(_:))

Sets the path to be displayed by the browser.

[`-  pathToColumn:`](/documentation/AppKit/NSBrowser/path(toColumn:))

Returns a string representing the path from the first column up to, but not including, the column at the given index.

[`pathSeparator`](/documentation/AppKit/NSBrowser/pathSeparator)

The path separator.

### Managing Columns

[`-  addColumn`](/documentation/AppKit/NSBrowser/addColumn())

Adds a column to the right of the last column.

[`selectedColumn`](/documentation/AppKit/NSBrowser/selectedColumn)

The index of the last column with a selected item.

[`lastColumn`](/documentation/AppKit/NSBrowser/lastColumn)

The index of the last column loaded.

[`firstVisibleColumn`](/documentation/AppKit/NSBrowser/firstVisibleColumn)

The index of the first visible column.

[`numberOfVisibleColumns`](/documentation/AppKit/NSBrowser/numberOfVisibleColumns)

The number of visible columns.

[`lastVisibleColumn`](/documentation/AppKit/NSBrowser/lastVisibleColumn)

The index of the last visible column.

[`-  validateVisibleColumns`](/documentation/AppKit/NSBrowser/validateVisibleColumns())

Validates the browser’s visible columns.

[`loaded`](/documentation/AppKit/NSBrowser/isLoaded)

A Boolean that indicates whether column 0 is loaded.

[`-  loadColumnZero`](/documentation/AppKit/NSBrowser/loadColumnZero())

Loads column 0; unloads previously loaded columns.

[`-  reloadColumn:`](/documentation/AppKit/NSBrowser/reloadColumn(_:))

Reloads the given column.

### Accessing Column Titles

[`-  titleOfColumn:`](/documentation/AppKit/NSBrowser/title(ofColumn:))

Returns the title displayed for the given column.

[`-  setTitle:ofColumn:`](/documentation/AppKit/NSBrowser/setTitle(_:ofColumn:))

Sets the title of the given column.

[`titled`](/documentation/AppKit/NSBrowser/isTitled)

A Boolean that indicates whether columns display titles.

[`-  drawTitleOfColumn:inRect:`](/documentation/AppKit/NSBrowser/drawTitle(ofColumn:in:))

Draws the title for the specified column within the given rectangle.

[`titleHeight`](/documentation/AppKit/NSBrowser/titleHeight)

The height of the column titles for the browser.

[`-  titleFrameOfColumn:`](/documentation/AppKit/NSBrowser/titleFrame(ofColumn:))

Returns the bounds of the title frame for the specified column.

### Updating Browsers

[`-  noteHeightOfRowsWithIndexesChanged:inColumn:`](/documentation/AppKit/NSBrowser/noteHeightOfRowsWithIndexesChanged(_:inColumn:))

Immediately retiles the browser’s columns using row heights specified by the browser’s delegate.

[`-  reloadDataForRowIndexes:inColumn:`](/documentation/AppKit/NSBrowser/reloadData(forRowIndexes:inColumn:))

Updates the rows in the column with the specified column index with indexes in the specified set.

### Scrolling

[`hasHorizontalScroller`](/documentation/AppKit/NSBrowser/hasHorizontalScroller)

A Boolean that indicates whether the browser has a horizontal scroller.

[`-  scrollColumnToVisible:`](/documentation/AppKit/NSBrowser/scrollColumnToVisible(_:))

Scrolls to make the specified column visible.

[`-  scrollColumnsLeftBy:`](/documentation/AppKit/NSBrowser/scrollColumnsLeft(by:))

Scrolls columns left by the specified number of columns.

[`-  scrollColumnsRightBy:`](/documentation/AppKit/NSBrowser/scrollColumnsRight(by:))

Scrolls columns right by the specified number of columns.

[`-  scrollRowToVisible:inColumn:`](/documentation/AppKit/NSBrowser/scrollRowToVisible(_:inColumn:))

Scrolls the specified row to be visible within the specified column.

### Dragging

[`-  setDraggingSourceOperationMask:forLocal:`](/documentation/AppKit/NSBrowser/setDraggingSourceOperationMask(_:forLocal:))

Specifies the drag-operation mask for dragging operations with local or external destinations.

[`-  canDragRowsWithIndexes:inColumn:withEvent:`](/documentation/AppKit/NSBrowser/canDragRows(with:inColumn:with:))

Indicates whether the browser can attempt to initiate a drag of the given rows for the given event.

[`-  draggingImageForRowsWithIndexes:inColumn:withEvent:offset:`](/documentation/AppKit/NSBrowser/draggingImageForRows(with:inColumn:with:offset:))

Provides an image to represent dragged rows during a drag operation on the browser.

### Getting Column Frames

[`-  frameOfColumn:`](/documentation/AppKit/NSBrowser/frame(ofColumn:))

Returns the rectangle containing the given column.

[`-  frameOfInsideOfColumn:`](/documentation/AppKit/NSBrowser/frame(ofInsideOfColumn:))

Returns the rectangle containing the specified column, not including borders.

### Getting Row Frames

[`-  frameOfRow:inColumn:`](/documentation/AppKit/NSBrowser/frame(ofRow:inColumn:))

Returns the frame of the cell at the specified location, including the expandable arrow.

[`-  getRow:column:forPoint:`](/documentation/AppKit/NSBrowser/getRow(_:column:for:))

Gets the row and column coordinates for the specified point, if a cell exists at that point.

### Managing Actions

[`doubleAction`](/documentation/AppKit/NSBrowser/doubleAction)

The browser’s double-click action method.

[`sendsActionOnArrowKeys`](/documentation/AppKit/NSBrowser/sendsActionOnArrowKeys)

A Boolean that indicates whether pressing an arrow key causes an action message to be sent.

[`-  sendAction`](/documentation/AppKit/NSBrowser/sendAction())

Sends the action message to the target.

### Handling Mouse-Click Events

[`-  doClick:`](/documentation/AppKit/NSBrowser/doClick(_:))

Responds to (single) mouse clicks in a column of the browser.

[`-  doDoubleClick:`](/documentation/AppKit/NSBrowser/doDoubleClick(_:))

Responds to double clicks in a column of the browser.

[`clickedColumn`](/documentation/AppKit/NSBrowser/clickedColumn)

The column number of the cell that the user clicked to display a context menu.

[`clickedRow`](/documentation/AppKit/NSBrowser/clickedRow)

The row number of the cell that the user clicked to display a context menu.

### Sizing

[`+  removeSavedColumnsWithAutosaveName:`](/documentation/AppKit/NSBrowser/removeSavedColumns(withAutosaveName:))

Removes the column configuration data stored under the given name from the application’s user defaults.

[`columnsAutosaveName`](/documentation/AppKit/NSBrowser/columnsAutosaveName-swift.property)

The name used to automatically save the browser’s column configuration.

[`ColumnsAutosaveName`](/documentation/AppKit/NSBrowser/ColumnsAutosaveName-swift.typealias)

[`-  columnContentWidthForColumnWidth:`](/documentation/AppKit/NSBrowser/columnContentWidth(forColumnWidth:))

Returns the content width for a given column width.

[`-  columnWidthForColumnContentWidth:`](/documentation/AppKit/NSBrowser/columnWidth(forColumnContentWidth:))

Returns the column width for the width of the given column’s content.

[`columnResizingType`](/documentation/AppKit/NSBrowser/columnResizingType-swift.property)

A constant indicating the browser’s column resizing type.

[`prefersAllColumnUserResizing`](/documentation/AppKit/NSBrowser/prefersAllColumnUserResizing)

A Boolean that indicates whether the browser is set to resize all columns simultaneously rather than resizing a single column at a time.

[`-  widthOfColumn:`](/documentation/AppKit/NSBrowser/width(ofColumn:))

Returns the width of the specified column.

[`-  setWidth:ofColumn:`](/documentation/AppKit/NSBrowser/setWidth(_:ofColumn:))

Sets the width of the specified column.

[`-  defaultColumnWidth`](/documentation/AppKit/NSBrowser/defaultColumnWidth())

Returns the default column width of the browser’s columns.

[`-  setDefaultColumnWidth:`](/documentation/AppKit/NSBrowser/setDefaultColumnWidth(_:))

Sets the default column width for new browser columns that do not otherwise have an initial width from defaults or the browser’s delegate.

[`rowHeight`](/documentation/AppKit/NSBrowser/rowHeight)

The height of the browser’s rows.

### Constants

[`ColumnResizingType`](/documentation/AppKit/NSBrowser/ColumnResizingType-swift.enum)

Types of browser column resizing.

[`DropOperation`](/documentation/AppKit/NSBrowser/DropOperation)

The type used to specify the drop type of a drag-and-drop operation. See [`browser(_:validateDrop:proposedRow:column:dropOperation:)`](/documentation/AppKit/NSBrowserDelegate/browser(_:validateDrop:proposedRow:column:dropOperation:)) for more information.

[Application Kit Versions for NSBrowser Functionality](/documentation/AppKit/application-kit-versions-for-nsbrowser-functionality)

The version of the AppKit.framework containing a specific bug fix or capability.

### Notifications

[`NSBrowserColumnConfigurationDidChangeNotification`](/documentation/AppKit/NSBrowser/columnConfigurationDidChangeNotification)

Notifies the delegate when the width of a browser column has changed.

### Deprecated

[`-  updateScroller`](/documentation/AppKit/NSBrowser/updateScroller)

Updates the horizontal scroller to reflect column positions.

[`-  scrollViaScroller:`](/documentation/AppKit/NSBrowser/scrollViaScroller:)

Scrolls columns left or right based on an `NSScroller`.

[`-  displayAllColumns`](/documentation/AppKit/NSBrowser/displayAllColumns)

Updates the browser to display all loaded columns.

[`-  displayColumn:`](/documentation/AppKit/NSBrowser/displayColumn:)

Updates the browser to display the given column.

[`-  columnOfMatrix:`](/documentation/AppKit/NSBrowser/column(of:))

Returns the column number in which the given matrix is located.

[`-  matrixInColumn:`](/documentation/AppKit/NSBrowser/matrix(inColumn:))

Returns the matrix located in the specified column.

[`-  matrixClass`](/documentation/AppKit/NSBrowser/matrixClass())

Returns the matrix class used in the browser’s columns.

[`-  setMatrixClass:`](/documentation/AppKit/NSBrowser/setMatrixClass(_:))

Sets the matrix class to be used in the browser’s columns.

### Instance Methods

[`selectedCell()`](/documentation/AppKit/NSBrowser/selectedCell())

[`-  acceptsArrowKeys`](/documentation/AppKit/NSBrowser/acceptsArrowKeys)

Indicates whether the browser allows navigation using the arrow keys.

[`-  setAcceptsArrowKeys:`](/documentation/AppKit/NSBrowser/setAcceptsArrowKeys:)

Specifies whether the browser allows navigation using the arrow keys.

## Relationships

### Conforms To

[`NSAccessibilityProtocol`](/documentation/AppKit/NSAccessibilityProtocol)

[`NSStandardKeyBindingResponding`](/documentation/AppKit/NSStandardKeyBindingResponding)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`NSAnimatablePropertyContainer`](/documentation/AppKit/NSAnimatablePropertyContainer)

[`NSAppearanceCustomization`](/documentation/AppKit/NSAppearanceCustomization)

[`Hashable`](/documentation/Swift/Hashable)

[`Equatable`](/documentation/Swift/Equatable)

[`NSUserActivityRestoring`](/documentation/AppKit/NSUserActivityRestoring)

[`NSCoding`](/documentation/Foundation/NSCoding)

[`NSDraggingDestination`](/documentation/AppKit/NSDraggingDestination)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`NSTouchBarProvider`](/documentation/AppKit/NSTouchBarProvider)

[`NSUserInterfaceItemIdentification`](/documentation/AppKit/NSUserInterfaceItemIdentification)

[`Sendable`](/documentation/Swift/Sendable)

[`CVarArg`](/documentation/Swift/CVarArg)

[`NSAccessibilityElementProtocol`](/documentation/AppKit/NSAccessibilityElementProtocol)

### Inherits From

[`NSControl`](/documentation/AppKit/NSControl)

---

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)