Contents

UIPencilInteraction

An interaction that tells your app when a person double-taps or squeezes Apple Pencil.

Declaration

@MainActor class UIPencilInteraction

Overview

People can interact with certain models of Apple Pencil with a double tap or squeeze. To detect the double tap or squeeze in your app, create a UIPencilInteraction object with a corresponding delegate object. Then, add the interaction to your app’s view. When a person double-taps or squeezes Apple Pencil, the interaction calls the delegate’s corresponding pencilInteraction(_:didReceiveTap:) or pencilInteraction(_:didReceiveSqueeze:) method.

For more information, read Handling double taps from Apple Pencil and Handling squeezes from Apple Pencil.

Topics

Creating interactions

Handling interactions

Enabling interactions

Determining preferences for actions

Determining input type

Determining hover preview preferences

Supporting types

See Also

Apple Pencil interactions in UIKit