Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
danielsaidi/KeyboardKit
KeyboardKit
About KeyboardKit
KeyboardKit helps you create custom keyboard extensions for iOS
and ipadOS
.
KeyboardKit provides you with a rich set of tools
and actions
, haptic
and audio
feedback, input sets
, keyboard layouts
, autocomplete
etc. and It you create keyboards with characters
, numbers
, symbols
, emojis
, images
or entirely custom keyboards that make use of the vast extensions to the native framework.
The end result can look something like this, or entirely different:
If you're new to iOS keyboard extensions, this great guide can help you get started. You can also have a look at the demo apps for inspiration.
Installation
Swift Package Manager
https://github.com/danielsaidi/KeyboardKit.git
CocoaPods
target 'MyApp' do
pod 'KeyboardKit'
end
target 'MyKeyboard' do
pod 'KeyboardKit'
end
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['APPLICATION_EXTENSION_API_ONLY'] = 'No'
end
end
end
Getting Started
With KeyboardKit
, you should inherit KeyboardInputViewController
instead of UIInputViewController
. It provides you with many tools that helps you build custom keyboard extension.
KeyboardKit supports both UIKit
and SwiftUI
, so you can pick the option that suits your needs best.
UIKit
KeyboardKit contains a rich set of tools to create UIKit
-based keyboards.
Read more here and see this tutorial for some examples. You can also checkout the UIKit demo for inspiration.
SwiftUI
KeyboardKit can be extended with KeyboardKitSwiftUI to create SwiftUI
-based keyboards.
Read more here and see this tutorial for some examples. You can also checkout the SwiftUI demo for inspiration.
SwiftUI is the future
SwiftUI
is the main focus going forward, and will be the main technology from version 4.0
. UIKit-specific functionality will then be removed. Read more about this decision here.
Actions
KeyboardKit supports many different keyboard actions, like character
inputs, emoji
inputs, backspace
, newline
, space
, image
etc. You can even create your own, custom actions.
Keyboard Types
KeyboardKit supports many different keyboard types, like alphabetic
, numeric
, symbolic
, emoji
etc. You can even create your own, custom keyboard types.
Input Sets
KeyboardKit provides you with locale-specific input sets, which makes it easy to create alphabetic
, numeric
and symbolic
keyboards in many languages.
Keyboard Layouts
KeyboardKit can combine an input set with surrounding actions to create a keyboard layout, which is the total set of actions on a keyboard.
Autocomplete
KeyboardKit supports autocomplete and can present autocomplete suggestions to users as they type.
Haptic Feedback
KeyboardKit supports haptic feedback and can give users haptic feedback as they type.
Audio Feedback
KeyboardKit supports audio feedback and can give users audio feedback as they type.
Extensions
KeyboardKit comes with many keyboard-specific extensions. Check out the demo apps and source code for examples and more information.
Demo Applications
This repository contains two demo apps that demonstrate different keyboard types, like alphabetical
(lower/uppercased and caps locked), numerical
, symbols
, emojis
and images
.
KeyboardKitDemoKeyboard
usesUIKit
to implement various keyboards that mimics system keyboards.KeyboardKitDemoKeyboard_SwiftUI
usesSwiftUI
to implement the same keyboards in another way.
The demo apps are not intended to be production ready keyboards, but rather to give you inspiration to how you can build your own keyboards.
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 to support all features, like audio and haptic feedback.
Contact me
Feel free to reach out if you have questions or if you want to contribute in any way:
- E-mail: daniel.saidi@gmail.com
- Twitter: @danielsaidi
- Web site: danielsaidi.com
Clients
KeyboardKit is proudly supported by:


Your company can support KeyboardKit by either sponsoring the project on GitHub Sponsors or by paying for consultation. I'ld be happy to help you out with your keyboard needs.
License
KeyboardKit is available under the MIT license. See LICENSE file for more info.
Github
link |
Stars: 398 |
Last commit: 50 minutes ago |
Related Packages
You may find interesting
Dependencies
Releases
- 2021-01-21T00:08:40
This release fixes so that the secondary input gesture triggers a tap if there were no secondary actions in the callout.
New features
-
Emoji
is a new struct that in the future will let us work more with emojis in a more structured and type-safe way. -
EmojiCategory
now lets you register afrequentEmojiProvider
, and uses that to populate the frequent category. -
There is a new
EmojiProvider
protocol -
There is a new
FrequentEmojiProvider
protocol -
There is a new
MostRecentEmojiProvider
class -
There is a new
String+Delimiters
extension with word and sentence delimiters. -
There are new
UITextDocumentProxu+Content
extensions to get previous sentences and words. -
AutocompleteToolbar
has a new, staticstandardReplacement
function. -
AutocompleteToolbar
has a new, staticstandardReplacementAction
function. -
AutocompleteToolbar
now lets you provide an optional, customreplacementAction
in init. -
Color+Resources
is a new extension that provides asset-based colors that adapt to dark mode. -
EmojiCategoryKeyboard
is a new view that lists the emojis of a selected category and a menu. -
EmojiCategoryKeyboardMenu
is a new view that lets the user select one of multiple categories. -
EmojiKeyboard
is a new view that renders a set of emojis in a lazy grid. The item action is customizable.
Behavior changes
-
EmojiCategory
now implementsEmojiProvider
-
EmojiCategory.frequent
now returns emojis from thefrequentEmojiProvider
. -
StandardKeyboardActionHandler
now tries to register emojis with theEmojiCategory
frequent emoji provider. -
Color+Button
uses the new asset-based colors. -
SystemKeyboardButtonBody
now only offsets small caps texts. -
The emoji action has a filled standard image instead of an outlined one.
-
Due to a secondary callout action bug, the secondary context is now created by the vc.
Bug fixes
- The
´
accent was accidentally used in standard numeric keyboards. It has now been replaced with’
, which is the correct one.
Deprecations
-
KeyboardContext.emojiCategory
has been deprecated. This should be persisted by the view instead. -
PhotosImageService
and the standard implementation has been deprecated. Copy it to your own project if you want to keep on using it. -
UIImage+Photos
has been deprecated. Copy it to your own project if you want to keep on using it. -
Some button-specific
Color
extensions have been deprecated. -
View+keyboardAction(:context:)
has been deprecated.
Breaking changes
secondaryCalloutInputProvider
has been removed fromKeyboardContext
. It's now only in the secondary context.