KeyboardKitPro

KeyboardKit Pro helps you create custom keyboards for iOS and iPadOS.

OTHER License

Stars
107
Committers
1

About KeyboardKit Pro

KeyboardKit is a SwiftUI SDK that lets you create fully customizable keyboard extensions with a few lines of code.

KeyboardKit Pro extends KeyboardKit with features like autocomplete & autocorrect, AI support, a powerful emoji keyboard, dictation, themes, app templates, and much more.

Keyboard extensions can be used within all other apps on iOS, where text input is supported. It's the only way for your product or brand to directly interact with other apps on iOS. Don't miss out!

Commercial License

KeyboardKit Pro requires a license to be used. You can sign up on the KeyboardKit website or the Gumroad store.

Installation

KeyboardKit Pro can be installed with the Swift Package Manager:

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

[!IMPORTANT] Unlike KeyboardKit, KeyboardKit Pro is a binary target and must only be linked to the app target.

Getting started

To use KeyboardKit in a keyboard extension, just import KeyboardKitPro and let your KeyboardViewController inherit KeyboardInputViewController instead of UIInputViewController:

import KeyboardKitPro

class KeyboardController: KeyboardInputViewController {}

This gives you access to lifecycle functions like viewWillSetupKeyboardView, observable state, services, etc.

The easiest way to set up KeyboardKit is to use create a KeyboardApp value to define information for your app:

extension KeyboardApp {

    static var keyboardKitDemo: Self {
        .init(
            name: "KeyboardKit",
            licenseKey: "keyboardkitpro-license-key",
            bundleId: "com.keyboardkit.demo",
            appGroupId: "group.com.keyboardkit.demo",
            deepLinks: .init(app: "kkdemo://")
        )
    }
}

To set up your keyboard, just override viewDidLoad and call setupPro(for:) with your KeyboardApp:

class KeyboardViewController: KeyboardInputViewControllerย {

    override func viewDidLoad() {
        super.viewDidLoad()
        setupPro(for: .keyboardKitDemo) { result in
            // Use the result or handle the error if you want
        }
    }
}

This will make KeyboardSettings sync data between the main app and its keyboard if an appGroupId is defined, register a KeyboardKit Pro license if a licenseKey is defined, set up dictation, deep links, etc.

To replace or customize the standard, English KeyboardView, just override viewWillSetupKeyboardView and call setupKeyboardView with the view you want to use:

class KeyboardViewController: KeyboardInputViewControllerย {

    override func viewWillSetupKeyboardView() {
        super.viewWillSetupKeyboardView()
        setupKeyboardView { [weak self] controller in // <-- Use weak or unknowned self!
            KeyboardView(
                state: controller.state,
                services: controller.services,
                buttonContent: { $0.view },
                buttonView: { $0.view },
                emojiKeyboard: { $0.view },
                toolbar: { _ in MyCustomToolbar() }
            )
        }
    }
}

To set up the main app with the same configuration as the keyboard extension, just wrap the main content view in a KeyboardAppView and provide it with the same app information:

import SwiftUI
import KeyboardKit

@main
struct MyApp: App {

    var body: some Scene {
        WindowGroup {
            KeyboardAppView(for: .keyboardKitDemo) {
                ContentView()
            }
        }
    }
}

This will make KeyboardSettings sync data between the main app and its keyboard if an appGroupId is defined, register a KeyboardKit Pro license if a licenseKey is defined, set up dictation, deep links, etc.

For more information, please see the getting started guide.

Localization

KeyboardKit supports 68 keyboard-specific locales:

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

KeyboardKit only includes built-in support for English, whileย KeyboardKit Pro unlocks localized keyboards, layouts, callouts and behaviors for all supported locales.

Open-Source Features

KeyboardKit comes packed with free, open-source features to help you build amazing custom keyboards:

Pro Features

KeyboardKit Pro extends KeyboardKit with Pro features:

  • โŒจ๏ธ Essentials - More essential tools, keyboard previews, etc.
  • ๐Ÿค– AI - Features that are needed for AI.
  • ๐Ÿ“ฑ App - App-specific screens & views.
  • ๐Ÿ’ก Autocomplete - On-device & remote autocomplete.
  • ๐Ÿ—ฏ Callouts - Localized callouts for 68 locales.
  • ๐ŸŽค Dictation - Trigger dictation from the keyboard.
  • ๐Ÿ˜€ Emojis - A powerful emoji keyboard.
  • โŒจ๏ธ External - Detect if an external keyboard is connected.
  • ๐Ÿ  Host - Identify and open specific host applications.
  • ๐Ÿ”ฃ Layout - Localized layouts for 68 locales.
  • ๐ŸŒ Localization - Services & views for 68 locales.
  • ๐Ÿ‘ Previews - Keyboard & theme previews for in-app use.
  • โžก๏ธ Proxy - Let UITextDocumentProxy read the full document.
  • ๐Ÿ“ Text - Let users type within the keyboard.
  • ๐Ÿญ Themes - A theme engine with many pre-defined themes.

Documentation

The online documentation has more information, getting-started guides, articles, code examples, etc.

Demo App

The main repository has a demo app that shows how to set up the main keyboard app, show keyboard status, provide in-app settings, link to system settings, apply custom styles, etc.

The app has two keyboards - a Keyboard that uses KeyboardKit and a KeyboardPro that uses KeyboardKit Pro. Note that you need to enable Full Access for some features to work, like haptic feedback.

[!IMPORTANT] The demo isn't code signed, and can therefore not sync settings between the app and its keyboards. As such, the KeyboardPro keyboard has the same settings screens to provide in-keyboard settings.

KeyboardKit App

If you want to try KeyboardKit without having to write any code or build the demo app from Xcode, the KeyboardKit app lets you try out many features by just downloading it from the App Store.

Contact

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

Commercial License

KeyboardKit Pro requires a license to be used. You can sign up on the KeyboardKit website or the Gumroad store.