Class

NSOpenPanel

The Open panel for the Cocoa user interface.

Overview

Apps use the Open panel as a convenient way to query the user for the name of a file to open. 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.

Topics

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

See Also

Open and Save Panels

class NSSavePanel

A Save panel that you can run in a modal loop.

protocol NSOpenSavePanelDelegate

A set of methods that a delegate of NSOpenPanel or NSSavePanel should implement.