Class

NSScreen

An NSScreen object describes the attributes of a computer’s monitor, or screen. An application may use an NSScreen object to retrieve information about a screen and use this information to decide what to display upon that screen. For example, an application may use the deepest() method to find out which of the available screens can best represent color and then may choose to display all of its windows on that screen.

Overview

The application object should be created before you use the methods in this class, so that the application object can make the necessary connection to the window system. You can make sure the application object exists by invoking the shared() method of NSApplication. If you created your application with Xcode, the application object is automatically created for you during initialization.

Symbols

Getting NSScreen Objects

class func main()

Returns the NSScreen object containing the window with the keyboard focus.

class func deepest()

Returns an NSScreen object representing the screen that can best represent color.

class func screens()

Returns an array of NSScreen objects representing all of the screens available on the system.

Getting Screen Information

var depth: NSWindowDepth

The current bit depth and colorspace information of the receiver.

var frame: NSRect

The dimensions and location of the receiver.

var supportedWindowDepths: UnsafePointer<NSWindowDepth>

A zero-terminated array of the window depths supported by the receiver.

var deviceDescription: [String : Any]

The device dictionary for the screen.

var visibleFrame: NSRect

The current location and dimensions of the visible screen.

var colorSpace: NSColorSpace?

The color space of the screen.

class func screensHaveSeparateSpaces()

Returns a Boolean value that indicates whether each screen can have its own set of spaces.

Screen Backing Coordinate Conversion

func backingAlignedRect(NSRect, options: AlignmentOptions = [])

Converts a rectangle in global screen coordinates to a pixel aligned rectangle.

var backingScaleFactor: CGFloat

The backing store pixel scale factor for the screen.

func convertRectFromBacking(NSRect)

Converts the rectangle from the device pixel aligned coordinates system of a screen.

func convertRectToBacking(NSRect)

Converts the rectangle to the device pixel aligned coordinates system of a screen.

Extended Dynamic Range

var maximumExtendedDynamicRangeColorComponentValue: CGFloat

The current maximum color component value for the screen.

Notifications

static let NSScreenColorSpaceDidChange: NSNotification.Name

Posted when the colorSpace of the screen has changed.

Relationships

Inherits From

Conforms To