Apple Pencil interactions
Handle user interactions like double tap and squeeze on Apple Pencil.
Overview
Apple Pencil interactions let a person perform certain actions in your app by double-tapping or squeezing an Apple Pencil. Support Apple Pencil interactions to give people a quick way to perform their preferred action, such as switching between drawing tools, or a custom action that you define in your app.
[Image]
To learn more about supporting double-tap and squeeze interactions, read Handling double taps from Apple Pencil and Handling squeezes from Apple Pencil.
To learn more about handling touches, read Handling input from Apple Pencil.
To learn more about incorporating hand-drawn content in your app, see Drawing with PencilKit.
Topics
Essentials
Handling double taps from Apple PencilHandling squeezes from Apple PencilHandling input from Apple Pencil
Apple Pencil interactions in SwiftUI
onPencilDoubleTap(perform:)PencilDoubleTapGestureValueonPencilSqueeze(perform:)PencilSqueezeGesturePhasePencilSqueezeGestureValuePencilPreferredActionPencilHoverPose