/KeyboardKit

KeyboardKit helps you create custom keyboards for iOS and iPadOS.

Primary LanguageSwiftMIT LicenseMIT

KeyboardKit Logo

Version Swift 5.8 MIT License Twitter: @@getkeyboardkit Mastodon: @keyboardkit@techhub.social

About KeyboardKit

KeyboardKit helps you create custom keyboards for iOS and iPadOS, using Swift and SwiftUI. It extends Apple's native keyboard APIs and provides you with more functionality.

KeyboardKit lets you create keyboards that mimic native iOS keyboards in a few lines of code.

These keyboards can be customized to change input keys, layout, design, behavior etc. You can also use completely custom views.

Installation

KeyboardKit can be installed with the Swift Package Manager:

https://github.com/KeyboardKit/KeyboardKit.git

KeyboardKit supports iOS 14, macOS 11, tvOS 14 and watchOS 7, although some features are unavailable on some platforms.

Supported Locales

KeyboardKit is localized in 60+ keyboard-specific locales:

๐Ÿ‡ฆ๐Ÿ‡ฑ ๐Ÿ‡ฆ๐Ÿ‡ช ๐Ÿ‡ฆ๐Ÿ‡ฒ ๐Ÿ‡ง๐Ÿ‡พ ๐Ÿ‡ง๐Ÿ‡ฌ ๐Ÿ‡ฆ๐Ÿ‡ฉ ๐Ÿณ๏ธ ๐Ÿ‡ญ๐Ÿ‡ท ๐Ÿ‡จ๐Ÿ‡ฟ ๐Ÿ‡ฉ๐Ÿ‡ฐ
๐Ÿ‡ณ๐Ÿ‡ฑ ๐Ÿ‡ง๐Ÿ‡ช ๐Ÿ‡บ๐Ÿ‡ธ ๐Ÿ‡ฌ๐Ÿ‡ง ๐Ÿ‡บ๐Ÿ‡ธ ๐Ÿ‡ช๐Ÿ‡ช ๐Ÿ‡ซ๐Ÿ‡ด ๐Ÿ‡ต๐Ÿ‡ญ ๐Ÿ‡ซ๐Ÿ‡ฎ ๐Ÿ‡ซ๐Ÿ‡ท
๐Ÿ‡ง๐Ÿ‡ช ๐Ÿ‡จ๐Ÿ‡ญ ๐Ÿ‡ฌ๐Ÿ‡ช ๐Ÿ‡ฉ๐Ÿ‡ช ๐Ÿ‡ฆ๐Ÿ‡น ๐Ÿ‡จ๐Ÿ‡ญ ๐Ÿ‡ฌ๐Ÿ‡ท ๐Ÿ‡บ๐Ÿ‡ธ ๐Ÿ‡ฎ๐Ÿ‡ฑ ๐Ÿ‡ญ๐Ÿ‡บ
๐Ÿ‡ฎ๐Ÿ‡ธ ๐Ÿ‡ฎ๐Ÿ‡ฉ ๐Ÿ‡ฎ๐Ÿ‡ช ๐Ÿ‡ฎ๐Ÿ‡น ๐Ÿ‡ฐ๐Ÿ‡ฟ ๐Ÿ‡น๐Ÿ‡ฏ ๐Ÿ‡น๐Ÿ‡ฏ ๐Ÿ‡น๐Ÿ‡ฏ ๐Ÿ‡ฑ๐Ÿ‡ป ๐Ÿ‡ฑ๐Ÿ‡น
๐Ÿ‡ฒ๐Ÿ‡ฐ ๐Ÿ‡ฒ๐Ÿ‡พ ๐Ÿ‡ฒ๐Ÿ‡น ๐Ÿ‡ฒ๐Ÿ‡ณ ๐Ÿ‡ณ๐Ÿ‡ด ๐Ÿ‡ฎ๐Ÿ‡ท ๐Ÿ‡ต๐Ÿ‡ฑ ๐Ÿ‡ต๐Ÿ‡น ๐Ÿ‡ง๐Ÿ‡ท ๐Ÿ‡ท๐Ÿ‡ด
๐Ÿ‡ท๐Ÿ‡บ ๐Ÿ‡ท๐Ÿ‡ธ ๐Ÿ‡ท๐Ÿ‡ธ ๐Ÿ‡ธ๐Ÿ‡ฐ ๐Ÿ‡ธ๐Ÿ‡ฎ ๐Ÿ‡ช๐Ÿ‡ธ ๐Ÿ‡ฐ๐Ÿ‡ช ๐Ÿ‡ธ๐Ÿ‡ช ๐Ÿ‡น๐Ÿ‡ท ๐Ÿ‡บ๐Ÿ‡ฆ
๐Ÿ‡บ๐Ÿ‡ฟ

KeyboardKit comes with basic input sets, layouts and secondary callout actions.

Features

KeyboardKit comes packed features to help you build amazing and powerful keyboards:

  • โŒจ๏ธ Essentials - KeyboardKit comes with a bunch of essential features and types.
  • ๐Ÿ’ฅ Actions - KeyboardKit has keyboard actions like characters, actions, etc.
  • ๐Ÿค– AI Support - KeyboardKit has capabilities that are needed for AI.
  • ๐Ÿ’ก Autocomplete - KeyboardKit can perform autocomplete and autocorrect.
  • ๐Ÿ”ค Buttons - KeyboardKit can style any view as a keyboard button.
  • ๐Ÿ—ฏ Callouts - KeyboardKit can show input and secondary callouts.
  • ๐ŸŒˆ Colors - KeyboardKit defines a bunch of keyboard-related colors.
  • ๐Ÿ“ฑ Device Utilities - KeyboardKit has a bunch of device-specific utilities.
  • ๐ŸŽค Dictation (BETA) - KeyboardKit can perform dictation from the keyboard.
  • ๐Ÿ˜€ Emojis - KeyboardKit defines an emoji type with a lot of information.
  • ๐Ÿ”‰ Feedback - KeyboardKit can trigger audio and haptic feedback.
  • ๐Ÿ‘† Gestures - KeyboardKit has rich, keyboard-specific gestures.
  • ๐Ÿ–ผ๏ธ Images - KeyboardKit defines a bunch of keyboard-related images.
  • ๐Ÿ”ฃ Layout - KeyboardKit defines dynamic input sets and keyboard layouts.
  • ๐ŸŒ Localization - KeyboardKit supports 60+ locales.
  • ๐Ÿ—บ๏ธ Navigation - KeyboardKit lets you open urls and other apps.
  • ๐Ÿ‘ Previews - KeyboardKit lets you preview views and components in SwiftUI.
  • โžก๏ธ Proxy Extensions - KeyboardKit makes UITextDocumentProxy do a LOT more.
  • โš™๏ธ Settings - KeyboardKit has a bunch of settings tools.
  • ๐Ÿฉบ State - KeyboardKit lets you detect if a keyboard is enabled, has full access, etc.
  • ๐ŸŽจ Styling - KeyboardKit lets you style your keyboards to great extent.
  • ๐Ÿš Text Routing - KeyboardKit kan route text to other places.

KeyboardKit Pro extends these features with many pro features, such as fully localized keyboards, autocomplete, emoji keyboards, dictation, etc.

Getting Started

The online documentation has a getting-started guide that helps you get started with KeyboardKit.

After installing KeyboardKit, just import KeyboardKit and make your KeyboardViewController inherit KeyboardInputViewController instead of UIInputViewController:

import KeyboardKit

class KeyboardController: KeyboardInputViewController {}

This gives your controller access to new lifecycle functions, observable state, services, and much more.

KeyboardKit will by default use a standard SystemKeyboard. If you just want to use this standard view, you donโ€™t have to do anything more.

To customize or replace the standard view, you can override viewWillSetupKeyboard() and call any of the setup functions with a custom view:

class KeyboardViewController: KeyboardInputViewController {

    override func viewWillSetupKeyboard() {
        super.viewWillSetupKeyboard()
        setup { controller in
            SystemKeyboard(
                state: controller.state,
                services: controller.services,
                buttonContent: { $0.view },
                buttonView: { $0.view },
                emojiKeyboard: { $0.view },
                toolbar: { _ in MyCustomToolbar() }
            )
        }
    }
}

The setup view builder provides an unowned controller reference to help avoiding memory leaks. Use it to access its state and services, and avoid passing it around.

For more information, please see the online documentation and getting-started guide.

Documentation

The online documentation has articles, code examples etc.

KeyboardKit Pro

KeyboardKit Pro extends KeyboardKit with a lot of Pro features, such as localized keyboards and services, autocomplete, dictation, pro emoji features (keyboards, categories, versions, skintones, etc).

KeyboardKit Pro lets you create fully localized keyboards with a single line of code.

Demo App

The repository has a demo app that shows how to display keyboard state, link to system settings, etc. It has two keyboards:

  • Keyboard uses KeyboardKit and a standard SystemKeyboard.
  • KeyboardPro uses KeyboardKit Pro and a SystemKeyboard with 60+ locales, autocomplete, etc.

Just open and run the demo app in the Demo folder, then enable the keyboards under System Settings. Note that you need to enable full access for some features, like haptic feedback.

KeyboardKit App

If you want to try KeyboardKit Pro without having to write any code or build the demo app from Xcode, there is a [KeyboardKit app][app-store] in the App Store.

Support this project

KeyboardKit is open-source and completely free, but you can sponsor this project on GitHub Sponsors, upgrade to KeyboardKit Pro or get in touch for freelance work, paid support etc.

Contact

Feel free to reach out if you have questions or if you want to contribute in any way:

License

KeyboardKit is available under the MIT license. See the LICENSE file for more info.