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

# NSPathControl

A display of a file system path or virtual path information.

```
class NSPathControl
```

## Overview

The [`NSPathControl`](/documentation/AppKit/NSPathControl) class uses [`NSPathCell`](/documentation/AppKit/NSPathCell) to implement its user interface. [`NSPathControl`](/documentation/AppKit/NSPathControl) provides cover methods for most [`NSPathCell`](/documentation/AppKit/NSPathCell) methods—the cover method simply invokes the corresponding cell method. See also [`NSPathComponentCell`](/documentation/AppKit/NSPathComponentCell), which represents individual components of the path, and two associated protocols: [`NSPathCellDelegate`](/documentation/AppKit/NSPathCellDelegate) and [`NSPathControlDelegate`](/documentation/AppKit/NSPathControlDelegate).

[`NSPathControl`](/documentation/AppKit/NSPathControl) has three styles represented by the [`NSPathControl.Style`](/documentation/AppKit/NSPathControl/Style) enumeration constants [`NSPathControl.Style.standard`](/documentation/AppKit/NSPathControl/Style/standard), [`NSPathStyleNavigationBar`](/documentation/AppKit/NSPathStyle/NSPathStyleNavigationBar), and [`NSPathControl.Style.popUp`](/documentation/AppKit/NSPathControl/Style/popUp). The represented path can be a file system path or any other type of path leading through a sequence of nodes or components, as defined by the programmer.

[`NSPathControl`](/documentation/AppKit/NSPathControl) automatically supports drag and drop, which can be further customized via delegate methods. To accept drag and drop, [`NSPathControl`](/documentation/AppKit/NSPathControl) calls [`registerForDraggedTypes(_:)`](/documentation/AppKit/NSView/registerForDraggedTypes(_:)) with [`NSFilenamesPboardType`](/documentation/AppKit/NSFilenamesPboardType) and [`NSURLPboardType`](/documentation/AppKit/NSURLPboardType). When the URL value in the [`NSPathControl`](/documentation/AppKit/NSPathControl) object changes because of an automatic drag and drop operation or the user selecting a new path via the open panel, the action is sent. In OS X v10.5 the value returned by [`clickedPathComponentCell()`](/documentation/AppKit/NSPathControl/clickedPathComponentCell()) is `nil`, in macOS 10.6 and later, [`clickedPathComponentCell()`](/documentation/AppKit/NSPathControl/clickedPathComponentCell()) returns the clicked cell.

## Topics

### Setting the Control Style

[`pathStyle`](/documentation/AppKit/NSPathControl/pathStyle)

The receiver’s path style.

### Setting the Background Color

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

The receiver’s background color.

### Managing Path Components

[`-  clickedPathComponentCell`](/documentation/AppKit/NSPathControl/clickedPathComponentCell())

Returns the clicked cell.

[`-  pathComponentCells`](/documentation/AppKit/NSPathControl/pathComponentCells())

Returns an array of the `NSPathComponentCell` objects currently being displayed.

[`-  setPathComponentCells:`](/documentation/AppKit/NSPathControl/setPathComponentCells(_:))

Sets the array of `NSPathComponentCell` objects currently being displayed.

### Setting the Double-Click Action

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

The receiver’s double-click action method.

### Setting the Path

[`URL`](/documentation/AppKit/NSPathControl/url)

The path value displayed by the receiver.

### Setting the Delegate

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

The receiver’s delegate.

### Setting the Drag Operation Mask

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

Configures the drag operation mask.

### Setting Popup Menu

[`menu`](/documentation/AppKit/NSPathControl/menu)

The menu that is used for the path control’s cells.

### Instance Properties

[`allowedTypes`](/documentation/AppKit/NSPathControl/allowedTypes)

[`clickedPathItem`](/documentation/AppKit/NSPathControl/clickedPathItem)

[`editable`](/documentation/AppKit/NSPathControl/isEditable)

[`pathItems`](/documentation/AppKit/NSPathControl/pathItems)

[`placeholderAttributedString`](/documentation/AppKit/NSPathControl/placeholderAttributedString)

[`placeholderString`](/documentation/AppKit/NSPathControl/placeholderString)

### Enumerations

[`Style`](/documentation/AppKit/NSPathControl/Style)

`NSPathStyle` constants represent the different visual and behavioral styles an `NSPathControl` or `NSPathCell` object can have.

## Relationships

### Conforms To

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

### 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)