Instance Method

desktopImageOptions(for:)

Returns the desktop image options for the given screen.

Declaration

func desktopImageOptions(for screen: NSScreen) -> [NSWorkspace.DesktopImageOptionKey : Any]?

Parameters

screen

The screen for which to get the desktop image options.

Return Value

A dictionary containing key-value pairs specified in Desktop Image Dictionary Keys.

Discussion

You must call this method from your app’s main thread.

See Also

Managing the Desktop Image

func desktopImageURL(for: NSScreen) -> URL?

Returns the URL for the desktop image for the given screen.

func setDesktopImageURL(URL, for: NSScreen, options: [NSWorkspace.DesktopImageOptionKey : Any])

Sets the desktop image for the given screen to the image at the specified URL.

struct NSWorkspace.DesktopImageOptionKey

The following keys may be specified or returned in the options dictionary for setDesktopImageURL(_:for:options:).