Working with Screens

The NSScreen class encapsulates the attributes of a computer display such as its size in pixels and the number of supported colors. Each computer can have more than one attached display, and each display can have different attributes. The NSScreen class provides the +screens class method that returns an array of NSScreen instances that each encapsulate a display connected to the computer. The +deepestScreen method returns an NSScreen instance that encapsulates the display that supports the highest color fidelity. The +mainScreen method returns an NSScreen instance for the display that is currently showing the key window.

NSScreen’s -visibleFrame method was already used in the implementation of Image Viewer. NSScreen only ...

Get Cocoa® Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.