Contents

desktopDirectory

The standard directory for files on the desktop.

Declaration

static var desktopDirectory: URL { get }

Discussion

In iOS, this directory is within the app’s sandbox directory. In macOS, it’s within the app’s sandbox directory for sandboxed apps, or in the current user’s home directory (~/Desktop) if the app isn’t sandboxed.

This computed property is equivalent to calling NSSearchPathForDirectoriesInDomains(_:_:_:) with the FileManager.SearchPathDirectory.desktopDirectory parameter.

See Also

Accessing common directories