UIPencilInteraction
An interaction that tells your app when a person double-taps or squeezes Apple Pencil.
Declaration
@MainActor class UIPencilInteractionOverview
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.