<!--
{
  "availability" : [
    "macCatalyst: 13.1.0 -",
    "macOS: 10.2.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreGraphics",
  "identifier" : "/documentation/CoreGraphics/CGDisplayUnitNumber(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Core Graphics"
    ],
    "preciseIdentifier" : "c:@F@CGDisplayUnitNumber"
  },
  "title" : "CGDisplayUnitNumber(_:)"
}
-->

# CGDisplayUnitNumber(_:)

Returns the logical unit number of a display.

```
func CGDisplayUnitNumber(_ display: CGDirectDisplayID) -> UInt32
```

## Parameters

`display`

The identifier of the display to be accessed.

## Return Value

A logical unit number for the specified display.

## Discussion

The logical unit number represents a particular node in the I/O Kit device tree associated with the display’s framebuffer.

For a particular hardware configuration, this value will not change when the attached monitor is changed. The number will change, though, if the I/O Kit device tree changes, for example, when hardware is reconfigured, drivers are replaced, or significant changes occur to I/O Kit. Therefore keep in mind that this number may vary across login sessions.

For more information about I/O Kit, see [IOKit Fundamentals](https://developer.apple.com/library/archive/documentation/DeviceDrivers/Conceptual/IOKitFundamentals/Introduction/Introduction.html#//apple_ref/doc/uid/TP0000011).

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)