Contents

CGDisplayIsOnline(_:)

Returns a Boolean value indicating whether a display is connected or online.

Declaration

func CGDisplayIsOnline(_ display: CGDirectDisplayID) -> boolean_t

Parameters

  • display:

    The identifier of the display to be accessed.

Return Value

If true, the specified display is connected; otherwise, false.

Discussion

A display is considered connected or online when the framebuffer hardware is connected to a monitor.

You can use this function to determine whether someone has plugged a display into the system while the main power was on. This hardware feature, called hot-plugging, may not be present on all displays.

See Also

Functions