How do I design a good iPadOS keyboard input accessory view?

Asked on 08/07/2024

1 search

To design a good iPadOS keyboard input accessory view, you can follow these guidelines based on the content from the WWDC sessions:

  1. Use Input Accessory View: This view docks above the keyboard and handles the case when a hardware keyboard is used by docking the view at the bottom of the screen. This ensures that your accessory view is always accessible regardless of the keyboard type being used.

    • Example: If you need to place a view directly above the keyboard, using an input accessory view is recommended. This approach is demonstrated in the session Build multilingual-ready apps.
  2. Keyboard Layout Guide: If you want to customize the placement of views in relation to the keyboard, using the keyboard layout guide can be very helpful. This allows for more flexibility in positioning your views.

  3. Handling Marked Text: When dealing with languages like Chinese or Japanese, the keyboard uses marked text, which is temporary text before a suggestion is chosen. Ensure that your app checks for marked text before modifying the text to avoid interrupting the typing process.

    • Example: The session Build multilingual-ready apps discusses how to handle marked text properly to provide inline completions without disrupting the user’s typing.
  4. Feedback Generators: For apps that involve drawing or other interactive elements, consider using feedback generators to provide haptic feedback. This can enhance the user experience, especially when using Apple Pencil.

    • Example: The session What’s new in UIKit covers how to integrate drawing experiences with Apple Pencil Pro and provide a rich tool-picking experience with less code.

By following these guidelines, you can create a well-designed keyboard input accessory view that enhances the user experience on iPadOS.