In iOS, iPadOS, and tvOS, the system provides various types of onscreen keyboards people can use to enter data.
An onscreen keyboard can provide a specific set of keys that are optimized for the current task; for example, a keyboard that supports entering email addresses can include the “@” character and a period or even “.com”. An onscreen keyboard doesn’t enable keyboard shortcuts.
When it makes sense in your app, you can replace the system-provided keyboard with a custom view that enables app-specific data entry. You can also create an app extension that offers a custom keyboard people can install and use in place of the standard keyboard.
Match the onscreen keyboard to the type of content people are editing. For example, you can help people enter numeric data by providing the numbers and punctuation keyboard. When you specify a semantic meaning for a text input area, the system can automatically provide a keyboard that matches the type of input you expect, potentially using this information to refine the keyboard corrections it offers. For developer guidance, see UIKeyboardType and UITextContentType.
- ASCII Capable
- ASCII Capable Number Pad
- Decimal Pad
- Email Address
- Name Phone Pad
- Number Pad
- Numbers and Punctuation
- Phone Pad
- Web Search
Consider customizing the Return key label if it helps clarify the text-entry experience. For example, it might make sense to use “Join” or “Done” instead of “Return.” For developer guidance, see UIReturnKeyType.
Custom input views
You can create an input view if you want to provide custom functionality that enhances data-entry tasks in your app. For example, Numbers provides a custom input view for entering numeric values while editing a spreadsheet. A custom input view replaces the system-provided keyboard while people are in your app. For developer guidance, see inputViewController. If you want to create a custom keyboard that people can use in other apps as well as yours, you need to create an app extension that people can install.
Make sure your custom input view makes sense in the context of your app. In addition to making data entry simple and intuitive, you want people to understand the benefits of using your custom input view. Otherwise, they may wonder why they can’t regain the system keyboard while in your app.
Play the standard keyboard sound while people type. The keyboard sound provides familiar feedback when people tap a key on the system keyboard, so they’re likely to expect the same sound when they tap keys in your custom input view. People can turn keyboard clicks off for all keyboard interactions in Settings > Sounds. For developer guidance, see playInputClick.
Consider providing a custom input accessory view. An input accessory view can appear above an onscreen keyboard — whether standard or custom — providing app-specific functionality related to the data people are working with. For example, Numbers displays an input accessory view that helps people enter standard or custom calculations to apply to spreadsheet data. Avoid using an accessory view to display content that isn’t relevant to the current task. For developer guidance, see inputAccessoryView.
You can provide a custom keyboard that replaces the system keyboard by creating an app extension. An app extension is code you provide that people can install and use to extend the functionality of a specific area of the system; to learn more, see App extensions.
After people enable your custom keyboard in Settings, they can use it for text entry within any app, except when editing secure text fields and phone number fields. People can enable multiple custom keyboards and switch between them at any time. For developer guidance, see Creating a custom keyboard.
Custom keyboards make sense when you want to expose unique keyboard functionality systemwide, such as a novel way of inputting text or the ability to type in a language the system doesn’t support. If you want to provide a custom keyboard for people to use only while they're in your app, consider creating a custom input view instead.
Provide an obvious and easy way to switch between keyboards. People know that the Globe key on the standard keyboard — which replaces the Emoji key when multiple keyboards are enabled — quickly switches to other keyboards, and they expect a similarly intuitive experience in your keyboard.
Avoid duplicating system-provided keyboard features. On some devices, the Emoji/Globe key and Dictation key automatically appear beneath the keyboard, even when people are using custom keyboards. Your app can't affect these keys, and it's likely to be confusing if you repeat them in your keyboard.
Consider providing a keyboard tutorial in your app. People are used to the standard keyboard, and learning how to use a new keyboard can take time. You can help make the process easier by providing usage instructions in your app — for example, you might tell people how to enable your keyboard, activate it during text entry, use it, and switch back to the standard keyboard. Avoid displaying help content within the keyboard itself.
Not supported in macOS or watchOS.
Use the keyboard layout guide to make the keyboard feel like an integrated part of your interface. Using the layout guide also helps you keep important parts of your interface visible while the keyboard is onscreen. For guidance, see iOS keyboard layout guide.
On Apple Watch, people can launch the Apple Continuity Keyboard, entering text from a nearby iOS device signed in to the same iCloud account.
tvOS displays a linear onscreen keyboard when people select a text field using the Siri Remote.
NOTE A grid keyboard screen appears when people use devices other than the Siri Remote, and the layout of content automatically adapts to the keyboard.
When people activate a digit entry view, tvOS displays a digit-specific keyboard. For guidance, see Digit entry views.