KeyboardKit is a Swift library that helps you create custom keyboard extensions for iOS and ipadOS. It provides you with a rich set of keyboard-specific tools and actions, supports haptic and audio feedback and lets you create keyboards with characters, emojis, images, custom actions etc.
Swift Package Manager
target 'MyApp' do pod 'KeyboardKit' end target 'MyKeyboard' do pod 'KeyboardKit' end
KeyboardKit to your project, make your extension inherit
KeyboardInputViewController instead of
UIInputViewController. It provides you with many tools that helps you build custom keyboard extension.
KeyboardKit supports both
SwiftUI, so you can pick the option that suits your needs best.
SwiftUI support is currently kept in a separate library, but will be the main focus going forward.
2.7.0, KeyboardKit provides new tools that help you build SwiftUI-based keyboards. SwiftUI will be the main focus going forward, with the aim to improve SwiftUI support in version
3.x and move it to the main repo in
4.0. When this happens, KeyboardKit will target iOS 13 and up.
Due to a Swift toolchain bug, SwiftUI support must be kept in a separate library. Until the bug is fixed, you must add both
KeyboardKitSwiftUI to your project, if you want to use
KeyboardKit with SwiftUI.
KeyboardKit supports many different keyboard actions, like
image etc. You can even create your own, custom actions.
KeyboardKit supports many different keyboard types, like
emoji etc. You can even create your own, custom keyboard types.
KeyboardKit supports autocomplete and can present autocomplete suggestions to users as they type.
KeyboardKit supports haptic feedback and can give users haptic feedback as they type.
KeyboardKit supports audio feedback and can give users audio feedback as they type.
KeyboardKit comes with many keyboard-specific extensions. Check out the demo apps and source code for examples and more information.
Views and components
KeyboardKit comes with many views and components that can be composed into custom UIKit and SwiftUI-based keyboards, e.g.
This repository contains two demo apps that demonstrate different keyboard types, like
alphabetical (lower/uppercased and caps locked),
Note that audio feedback, haptic feedback and image actions require full access. Also, the
image switcher is only shown on notch devices.
To run the demo app, open and run the
KeyboardKit.xcodeproj project then enable the keyboards under system settings. Don't forget to enable full access.
Subscribe to iOS Example
Get the latest posts delivered right to your inbox