Class

NSOpenPanel

The NSOpenPanel class provides the Open panel for the Cocoa user interface. Applications use the Open panel as a convenient way to query the user for the name of a file to open.

Overview

In a sandboxed environment, Open panels are drawn in a separate process by the powerbox, not by AppKit itself. When the user chooses a file to open, macOS adds that file to the app’s sandbox.

Symbols

Configuring Panels

var canChooseFiles: Bool

A Boolean that indicates whether the panel allows the user to choose files to open.

var canChooseDirectories: Bool

A Boolean that indicates whether the panel allows the user to choose directories to open.

var resolvesAliases: Bool

A Boolean that indicates whether the panel resolves aliases.

var allowsMultipleSelection: Bool

A Boolean that indicates whether the panel’s browser allows the user to open multiple files (and directories) at a time.

Accessing User Selection

var urls: [URL]

An array containing the absolute paths of the selected files and directories as URLs.

Managing Ubiquitous Documents

var canDownloadUbiquitousContents: Bool

A Boolean that controls how the panel responds to ubiquitous documents that aren't yet fully downloaded locally.

var canResolveUbiquitousConflicts: Bool

A Boolean that controls how the panel responds to ubiquitous documents with conflicting versions.

Relationships

Inherits From