Class

NSScreen

An object that describes the attributes of a computer’s monitor or screen.

Declaration

@interface NSScreen : NSObject

Overview

An app 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 app may use the deepestScreen 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.

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 sharedApplication method of NSApplication. If you created your app with Xcode, the application object is automatically created for you during initialization.

Topics

Getting Screen Objects

mainScreen

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

deepestScreen

Returns a screen object representing the screen that can best represent color.

screens

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

Getting Screen Information

depth

The current bit depth and colorspace information of the screen.

frame

The dimensions and location of the screen.

supportedWindowDepths

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

deviceDescription

The device dictionary for the screen.

NSDeviceDescriptionKey

These constants are the keys for device description dictionaries used by deviceDescription.

- userSpaceScaleFactor

Returns the scaling factor from user space to device space on the screen.

Deprecated
visibleFrame

The current location and dimensions of the visible screen.

colorSpace

The color space of the screen.

- canRepresentDisplayGamut:

A Boolean value indicating whether the color space of the screen is capable of representing the specified display gamut.

screensHaveSeparateSpaces

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

Screen Backing Coordinate Conversion

- backingAlignedRect:options:

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

backingScaleFactor

The backing store pixel scale factor for the screen.

- convertRectFromBacking:

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

- convertRectToBacking:

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

Extended Dynamic Range

maximumPotentialExtendedDynamicRangeColorComponentValue

The maximum possible color component value for the screen when it's in extended dynamic range (EDR) mode.

Beta
maximumExtendedDynamicRangeColorComponentValue

The current maximum color component value for the screen.

maximumReferenceExtendedDynamicRangeColorComponentValue

The current maximum color component value for reference rendering to the screen.

Beta

Notifications

NSScreenColorSpaceDidChangeNotification

Posted when the color space of the screen has changed.

Instance Properties

Relationships

Inherits From

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software