<!--
{
  "availability" : [
    "iOS: 16.1.0 -",
    "iPadOS: 16.1.0 -",
    "macCatalyst: 16.1.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIHoverGestureRecognizer/zOffset",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UIHoverGestureRecognizer(py)zOffset"
  },
  "title" : "zOffset"
}
-->

# zOffset

A value that represents the normalized distance between the screen and a hovering pointing device, such as Apple Pencil.

```
var zOffset: CGFloat { get }
```

## Discussion

This value is `1` at the maximum distance from the screen and approaches `0` as the pointing device gets closer to the screen. This value is `0` for devices that don’t support [`zOffset`](/documentation/UIKit/UIHoverGestureRecognizer/zOffset).

For example, a drawing app might use the value of this property to generate a preview that indicates where a hovering Apple Pencil touches down on an iPad screen. For more information, see [Adopting hover support for Apple Pencil](/documentation/UIKit/adopting-hover-support-for-apple-pencil).

---

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)