---
title: zOffset
framework: uikit
role: symbol
role_heading: Instance Property
path: uikit/uihovergesturerecognizer/zoffset
---

# zOffset

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

## Declaration

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

## Discussion

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. 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.

## See Also

### Supporting Apple Pencil hover

- [altitudeAngle](uikit/uihovergesturerecognizer/altitudeangle.md)
- [azimuthAngle(in:)](uikit/uihovergesturerecognizer/azimuthangle(in:).md)
- [azimuthUnitVector(in:)](uikit/uihovergesturerecognizer/azimuthunitvector(in:).md)
- [rollAngle](uikit/uihovergesturerecognizer/rollangle.md)
