Class

UIPencilInteraction

An interaction that tells your app the user double-tapped their Apple Pencil.

Declaration

class UIPencilInteraction : NSObject

Overview

The user can interact with Apple Pencil by double-tapping it. To detect the double tap in your app, create a UIPencilInteraction object and assign it a delegate object. Then add the interaction to your app’s view. When the user double-taps their Pencil, the interaction calls the delegate’s pencilInteractionDidTap(_:) method.

Topics

Handling Interactions

var delegate: UIPencilInteractionDelegate?

The object that handles the double-tap interactions the user makes on their Apple Pencil.

protocol UIPencilInteractionDelegate

The interface an object implements to handle double taps the user makes on their Apple Pencil.

Enabling Interactions

var isEnabled: Bool

A Boolean value that specifies whether the system reports double taps on Apple Pencil to your app.

Determining User Preference

class var preferredTapAction: UIPencilPreferredAction

The user’s preferred double-tap action, as specified in the Settings app.

enum UIPencilPreferredAction

The preferred double-tap actions that a user can select from in the Settings app.

Relationships

Inherits From

See Also

Interactions

protocol UIPencilInteractionDelegate

The interface an object implements to handle double taps the user makes on their Apple Pencil.