Whenever possible, respect the user’s settings for the double-tap gesture. Apple Pencil responds to the double-tap gesture by changing how it draws, either directly (by changing the tool) or indirectly (by presenting color options). Although double-tap toggles between the current tool and the eraser by default, users can go to Settings and specify that double-tap should toggle between the current and previous tool, show and hide the color picker, or do nothing at all. If your app supports these behaviors, ensure a consistent experience by respecting the user’s systemwide settings for double-tap, and don’t expect them to learn new gestures for the same behaviors. If the systemwide double-tap settings don’t make sense in your app, you can still use the gesture to change the mode of Apple Pencil. For example, users of a 3D app with a mesh editing tool could use double-tap to toggle between the tool's raise and lower modes.
Give users a way to enable custom double-tap behavior if necessary. When your app supports some or all of the Apple Pencil double-tap behaviors, but you also support a custom double-tap behavior, offer a control that lets users enable the custom behavior. If users don’t have an explicit way to enable the custom behavior, they may get confused when your app doesn’t respond to their systemwide double-tap settings. In this scenario, make sure it’s easy for users to discover the alternative behaviors your app supports, but don’t enable them by default.
Never use the double-tap gesture to perform an action that modifies content. It’s possible for people to double-tap accidentally, which means that they may not even be aware that your app has performed the action. When double-tapping toggles between tool modes, it’s easy for users to reverse an accidental mode change by simply double-tapping again. In an app that uses the gesture to perform an action, however, users must disrupt their workflow to find a way to undo it. Even worse is an app that uses double-tap to perform a potentially destructive action: if users are unaware that the action has occurred, they can lose data.
For developer guidance, see Pencil Interactions.
Providing a Custom Drawing Experience
Using PencilKit, you can let people take notes, annotate documents and images, and draw with the same low-latency experience that iOS provides. PencilKit also makes it easy to create a custom drawing canvas in your app and offer a state-of-the-art tool picker and ink palette. For developer guidance, see PencilKit.
Help people draw on top of existing content. By default, the colors on your PencilKit canvas dynamically adjust to dark mode, so people can create content in either mode and the results will look great in both. However, when people draw on top of existing content like a PDF or a photo, you probably want to prevent the dynamic adjustment of colors so that the markup remains sharp and visible.
Make sure the tool picker doesn't obscure content when your app runs in a compact environment. In a regular environment, the tool picker floats above the content so people can move it out of the way, but in a compact environment the tool picker stays pinned to the bottom edge of the screen. To avoid obscuring people’s content, you can adjust the content view’s frame or the scroll view insets to account for the height of the tool picker.
Consider providing custom undo and redo buttons to display when your app runs in a compact environment. In a regular environment, the tool picker includes undo and redo buttons, but in a compact environment it doesn't. In a compact environment, you could display your custom buttons in a navigation bar. You might also consider supporting the standard 3-finger undo/redo gesture, so people can use it in any environment. For guidance, see Undo and Redo.