Keep up to date with the optimal device for your display.
A user can have multiple external displays connected directly to a Mac or to an external GPU. Each view in your app is shown on a single display, and each display is driven by a single GPU. The display in which your view appears and the GPU that drives the display can change dynamically; therefore, you need to prepare your app to handle these changes. Register for display change notifications, get the device that drives your view's display, and decide if your app should use that device to present rendered graphics.
Handle Display Change Notifications
Register for the following notifications so the system can notify your app about specific display changes:
NSWindow. The system posts this notification when any window, including the window containing your view, moves to a different display.
Did Change Screen Notification
NSApplication. The system posts this notification when the Mac's display configuration changes; for example, when the user connects or disconnects an external display from the system. Another example is when the GPU driving the display changes, such as when automatic graphics switching is enabled and the system switches between discrete and integrated GPUs to drive the display.
Did Change Screen Parameters Notification
When the system posts a display change notification, you can decide if you should get and use a new device.
To deregister from the previous notifications, call the