<!--
{
  "availability" : [
    "iOS: 17.5.0 -",
    "iPadOS: 17.5.0 -",
    "macCatalyst: 17.5.0 -",
    "visionOS: 26.2.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIPencilHoverPose",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UIPencilHoverPose"
  },
  "title" : "UIPencilHoverPose"
}
-->

# UIPencilHoverPose

An object that describes the hover pose of Apple Pencil during an interaction like double tap or squeeze.

```
@MainActor class UIPencilHoverPose
```

## Overview

Use the hover pose of Apple Pencil to support more complex interactions in response to a double tap or squeeze. Information about the hover pose — such as azimuth, altitude, and hover distance — is available when a person holds a supported model of Apple Pencil close to the screen during a double tap or squeeze.

The following code example shows how to use the [`location`](/documentation/UIKit/UIPencilHoverPose/location) of a hover pose to present a contextual palette near the tip of Apple Pencil.

```swift
func pencilInteraction(_ interaction: UIPencilInteraction,
                       didReceiveSqueeze squeeze: UIPencilInteraction.Squeeze) {
    let preferredAction = UIPencilInteraction.preferredSqueezeAction
    
    if preferredAction == .showContextualPalette, squeeze.phase == .ended {
        if let anchorPoint = squeeze.hoverPose?.location {
            presentContextualPalette(atLocation: anchorPoint)
        }
    }
}
```

## Topics

### Getting the hover characteristics

[`location`](/documentation/UIKit/UIPencilHoverPose/location)

The location of an Apple Pencil above the view’s bounds, in view’s coordinate space.

[`altitudeAngle`](/documentation/UIKit/UIPencilHoverPose/altitudeAngle)

A value that represents the altitude angle of Apple Pencil.

[`azimuthAngle`](/documentation/UIKit/UIPencilHoverPose/azimuthAngle)

A value that represents the azimuth angle of Apple Pencil.

[`azimuthUnitVector`](/documentation/UIKit/UIPencilHoverPose/azimuthUnitVector)

A value that represents the azimuth unit vector of Apple Pencil in the specified view.

[`rollAngle`](/documentation/UIKit/UIPencilHoverPose/rollAngle)

A value that represents the barrel-roll angle of Apple Pencil.

[`zOffset`](/documentation/UIKit/UIPencilHoverPose/zOffset)

A value that represents the normalized distance between the screen and Apple Pencil.

## Relationships

### Conforms To

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`Sendable`](/documentation/Swift/Sendable)

[`CVarArg`](/documentation/Swift/CVarArg)

[`Equatable`](/documentation/Swift/Equatable)

[`Hashable`](/documentation/Swift/Hashable)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

### Inherits From

[`NSObject-swift.class`](/documentation/ObjectiveC/NSObject-swift.class)

---

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)