Whenever possible, respect the user’s settings for the double-tap gesture. Apple Pencil 2 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, people 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, respect the systemwide settings for double-tap, and don’t expect people 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 2. 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 people a way to enable custom double-tap behavior if necessary. When your app supports some or all of the Apple Pencil 2 double-tap behaviors, but you also support a custom double-tap behavior, offer a control that lets people 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 people 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, people 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.
With Scribble and Apple Pencil, people can simply write wherever text is accepted in your app — they don’t have to tap or switch modes first. Because Scribble is fully integrated into iPadOS 14 and later, it’s available to all apps by default, just like the keyboard. The following guidelines help you enhance the default Scribble support and provide a great writing experience in your app.
Always make entering text feel fluid and effortless. By default, Scribble works in all standard text controls — such as text fields, text views, search fields, and editable fields in web content — except password fields. If you use a custom text field in your app, don’t make people tap or select it before they can begin writing.
Make Scribble available everywhere people might want to enter text. Unlike using the keyboard, using Apple Pencil encourages people to treat the screen the way they treat a sheet of paper. Help strengthen this perception in your app by making Scribble consistently available in places where text entry seems natural. For example, in Reminders, it’s natural for people to create a new reminder by writing it in the blank space below the last item, even though the area doesn’t contain a text field. For developer guidance, see UIIndirectScribbleInteraction.
Avoid distracting people while they write. Some text field behaviors work well for keyboard input, but can disrupt the natural writing experience that Apple Pencil enables. For example, it’s best to avoid displaying autocompletion text as people write in a text field because the suggestions can visually interfere with their writing. It’s also a good idea to hide a field’s placeholder text the moment people begin to write so that their input doesn’t appear to overlap it.
While people are writing in a text field, make sure it remains stationary and its contents don’t scroll. In some cases, it makes sense to move a text field when it becomes focused: for example, a search field might move to make more room to display results. Such a movement is fine when people are using the keyboard, but when they’re writing it can make them feel like they’ve lost control of where their input is going. If you can’t prevent a text field from moving, consider delaying the movement until people pause their writing (for developer guidance, see scribbleInteractionShouldDelayFocus(_:)).
It’s also important to prevent autoscrolling while people are writing and editing in a text field. When transcribed text autoscrolls, people might try to avoid writing on top of it. Worse, if text scrolls while people are using Apple Pencil to select it, they might select a different range of text than what they want.
Give people enough space to write. A small text field is fine when people use the keyboard to enter text, but it can feel uncomfortable to write in. When you know that Apple Pencil input is likely, improve the writing experience in your app by increasing the size of the text field before people begin to write in it or when they pause writing. Always avoid resizing a text field while people are writing.
For developer guidance, see UIScribbleInteraction.
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.