KeyboardKit is a Swift SDK that lets you create fully customizable keyboards with a few lines of code, using SwiftUI.
MIT License
Bot releases are visible (Hide)
This release rolls back the localized name adjustment in the last version, since the only locale that used this approach - Kurdish Sorani Arabic - had a language folder named ckb_AR
which wasn't recognized by Apple.
This caused uploads to App Store generate warnings. Rolling back this change will make uploads work again, without warnings.
If you want to customize the display name for a keyboard locale, you have to do so manually in your app.
KeyboardLocale
now only resolves localizedName
from its ID, as it did before 6.4.1.KKL10n
localizedName
property has been rolled back.This release adds a new localized strings and new document proxy extensions.
UITextDocumentProxy has a new fullDocumentContext() extension that gets all the text from the proxy, not just the closest one.
UITextDocumentProxy has a new fullDocumentContextBeforeInput() extension that gets all the text before the input cursor.
UITextDocumentProxy has a new fullDocumentContextAfterInput() extension that gets all the text after the input cursor.
KeyboardLocale now supports defining a localized string to override its localized name.
KeyboardLocale now uses localizedName from its localized strings, if any.
KeyboardLocale.kurdish_sorani_arabic has a new localized name and adjusted keyboard layouts.
This release bumps the package Swift version to 5.6
.
The release makes more types, extensions, mocks and unit tests available for macOS, tvOS and watchOS. It also binds a bunch of extensions to protocols, which make them show up in DocC and makes it possible to use them on more types.
There are also new layout utilities that make adjusting keyboard locales a lot easier, and a bunch of struct properties have been converted from let
to var
to make them mutable.
The demos have been adjusted as well, and there is a brand new demo keyboard that shows how to customize the layout.
KurdishSoraniPcInputSetProvider
is a new input set provider for Kurdish Sorani PC.KurdishSoraniPcCalloutActionProvider
is a new callout action provider for Kurdish Sorani PC.AlphabeticInputSet
has new kurdishSoraniPc
input set builder.CaseAdjustable
is a new protocol that can be implemented by types that should be able to adjust themselves to a casing.EmojiKeyboardStyle
now lets you provide a device type in the standard style builder.HapticFeedback
now uses HapticFeedbackPlayer
for its player
.InputCallout
now lets you provide a device type in the initializer.InputSet
properties are now mutable.InputSetItem
properties are now mutable.KeyboardColorReader
is a new protocol that is implemented by Color
and lets its implementations access keyboard colors.KeyboardContext
has a new keyboardType
property.KeyboardContext
no longer requires a controller in the initializer, although it's good to provide one.KeyboardFeedbackHandler
is now available on all platforms.KeyboardImageReader
is a new protocol that is implemented by Image
and lets its implementations access keyboard images.KeyboardLayout
has new ideal height and inset properties, which can be used to create new item types easier.KeyboardLayoutConfiguration
properties are now mutable.KeyboardLayoutConfiguration
has a new standard layout for device type.KeyboardLayoutItem
properties are now mutable.KeyboardLayoutItemSize
properties are now mutable.KeyboardRowItem
has a bunch of new collection extensions.StandardAutocompleteSuggestion
properties are now mutable.StandardKeyboardFeedbackHandler
is now available on all platforms.SystemAudio
now uses SystemAudioPlayer
for its player
.Color
extensions have been moved to KeyboardColorReader
.KeyboardContext
activeAppBundleId
has been converted to a calculated property.StandardKeyboardLayoutProvider
now fallbacks to iPhone layout instead of an empty layout.StandardKeyboardLayoutProviderTests
now runs on all platforms.String
casing extensions have been moved to CaseAdjustable
.Color.DarkAppearanceStrategy
is no longer used and has been deprecated.KeyboardContext
device
initializer and property has been deprecated.KeyboardContext
activeAppBundleId
no longer works in iOS 16 and has been deprecated.KeyboardLayoutConfiguration
standard configuration for idiom has been deprecated.KeyboardInputViewController
activeAppBundleId
no longer works in iOS 16 and has been deprecated.MockCollectionViewLayout
is no longer used and has been deprecated.Sequence
extensions for mapping casing are no longer used and have been deprecated.StandardKeyboardLayoutProvider
fallbackProvider
has been deprecated.StandardKeyboardLayoutProvider
layoutProvider(for:)
has been renamed to keyboardLayoutProvider(for:)
.This release adds two new locales and a bunch of input set changes.
AlphabeticInputSet
has new qwertz
and azerty
input set builders.AlphabeticInputSet
, NumericInputSet
and SymbolicInputSet
has input set builders for all keyboard locales.InputSetProvider
s that support QWERTY
, QWERTZ
and AZERTY
now lets you inject a custom alphabetic input set.KurdishSoraniArabicInputSetProvider
has been tweaked to render a more correct layout.StandardInputSetProvider
now handles lexicon-based completions differently and ignores single-char suggestions.KeyboardContext
has new hasKeyboardLocale
and hasKeyboardLocale
functions.AlphabeticInputSet
has a new qwerty
input set builder.NumericInputSet
has a new standard
input set builder.SymbolicInputSet
has a new standard
input set builder.SystemKeyboardLayoutProvider
layout util functions have been deprecated.This release adds a bunch of new emojis that have been added since emojis were last updated.
It also adds input set variants, such as .englishQwerty
, .englishAzerty
, .englishQwertz
etc. and introduces AlphabeticInputSet, NumericInputSet and SymbolicInputSet builders for all locales.
EmojiCategory
has a bunch of new emojis.
EnglishInputSetProvider
now supports specifying an alphabetic input set.
InputSetRow
has new convenience initializers.
KeyboardContext
has a new KeyboardLocale-based setLocale()
.
AlphabeticInputSet
, NumericInputSet
and SymbolicInputSet
has new set builders for .english
.
AlphabeticInputSet
also has new .englishQwerty
, .englishAzerty
, .englishQwertz
input sets.
DeviceSpecificInputSetProvider
has been deprecated.EnglishInputSetProvider
currency properties have been deprecated.InputSetProvider
row extensions have been deprecated.InputSetRow
initializer extensions have been deprecated.AutocompleteContext
has a new lastError
property.AutocompleteProvider
has a new caseAdjust(suggestion:for:)
extension to help handle casing.Bundle+KeyboardKit
adds a new .keyboardKit
bundle.StandardAutocompleteProvider
has a new caseAdjustExactMatch
init argument to let you choose whether or not to apply the case adjustment to exact matches.String+Casing
adds an isCapitalized
property to String.KeyboardColor
no longer needs or is affected by enabling preview mode.KKL10n
no longer needs or is affected by enabling preview mode.StandardAutocompleteProvider
in KeyboardKit Pro uses the new case adjustments to provide better completions.KeyboardInputViewController
will now update the autocomplete context on the main queue.KeyboardInputViewController
will now write any autocomplete errors to the context's lastError
property.KeyboardPreviewMode
is not longer needed and enabling it has no effect from now on.This version adds more primary button types.
KeyboardAction.PrimaryType
has new join
and custom
cases.KeyboardAction.PrimaryType
now maps unrepresented UIReturnKeyType
types to the new custom
type.UIReturnKeyType
has new extensions for getting the keyboardAction
and primaryButtonType
.KeyboardGestures
shortens the time it takes for the secondary action callout to be presented.This version makes the library build on more platforms and removes old, deprecated code.
ActionCalloutContext
has a new, static shared
property.ActionCalloutContext
has a new verticalOffset
that can be used to move the callout up and down.AudioFeedbackConfiguration
is now mutable.HapticFeedbackConfiguration
is now mutable.InputCalloutContext
has a new, static shared
property.KeyboardInputViewController
has a new didMoveToParent
property, which is used to avoid calling needsInputModeSwitchKey
when it generates a warning.space
actions and not character actions with a single space.ActionCallout
uses the new ActionCalloutContext
verticalOffset
to offset the callout bubble.ActionCalloutContext
applies a vertical offset to iPad devices, and adjust the demo toolbar to be 50 on iPad as well.StandardKeyboardBehavior
now has a 0.5 double tap threshold instead of 0.2, and also handles caps lock better.StandardKeyboardFeedbackHandler
now triggers the haptic feedback for long press on space, not the SpaceCursorDragGestureHandler
.SystemKeyboard
initializers now use nil
as default value for the controller and width, to avoid Swift errors in binary framework builds.UITextDocumentProxy
isCursorAtNewSentenceWithSpace
has been adjusted to handle non-empty space content.All previously deprecated code has been removed.
ActionCalloutContext
verticalOffset
has been moved to ActionCalloutStyle
.
Bundle
isExtension
has been made internal.
Color.standardButtonBackgroundColor(for:)
has been renamed to standardButtonBackground(for:)
.
Color.standardButtonForegroundColor(for:)
has been renamed to standardButtonForeground(for:)
.
Color.standardButtonShadowColor(for:)
has been renamed to standardButtonShadow(for:)
.
Color.standardDarkButtonBackgroundColor(for:)
has been renamed to standardDarkButtonBackground(for:)
.
Color.standardDarkButtonForegroundColor(for:)
has been renamed to standardDarkButtonForeground(for:)
.
KeyboardAction
isKeyboardType
has been removed.
KeyboardAction
isSpace
has been removed.
KeyboardAction
standardTextDocumentProxyInputAction
has been merged with standardTextDocumentProxyAction
.
KeyboardAppearance
systemKeyboardButtonStyle(for:)
has been renamed to buttonStyle(for:)
.
KeyboardFeedbackHandler
no longer has any action provider-based logic and no typealiases.
KeyboardInputViewController
needsInputModeSwitchKeyOverride
has been removed.
StandardKeyboardActionHandler
GestureAction
has been removed.
StandardKeyboardFeedbackHandler
triggerFeedbackForLongPressOnSpaceDragGesture
has been removed.
StandardKeyboardFeedbackHandler
shouldTriggerFeedback
has been moved to StandardKeyboardActionHandler
.
SystemKeyboardButtonStyle
has been renamed to KeyboardButtonStyle
.
SystemKeyboardButtonBorderStyle
has been renamed to KeyboardButtonBorderStyle
.
SystemKeyboardButtonShadowStyle
has been renamed to KeyboardButtonShadowStyle
.
This version polishes the action callout on iPad further and fixes a layout bug.
ActionCalloutContext
has a new verticalOffset
property.ActionCallout
is now pushed down a bit on iPad devices.KeyboardInputViewController
no longer syncs context on viewWillLayoutSubviews
.KeyboardInputViewController
could get stuck in a loop due to syncing context in viewWillLayoutSubviews
.This version polishes the action callout on iPad and makes the core library build on macOS.
ActionCalloutStyle
has a new maxButtonSize
property.ActionCallout
now renders differently on iPad devices.ActionCalloutContext
now requires a little less swiping to change action.This version adds new locales and makes the library build on more platforms.
DeviceSpecificInputSetProvider
has new row functions.DeviceType
is a new enum that can be used to determine device type without having to use the real platform-specific device type.DisabledHapticFeedbackPlayer
is a new feedback player that is used on tvOS and watchOS.InputSetProvider
has new row functions.StandardHapticFeedbackPlayer
is now open to subclassing.StandardKeyboardLayoutProvider
has a new fallbackProvider
that is used when device is not iPhone or iPad.StandardSystemAudioPlayer
is now open to subclassing.StaticKeyboardBehavior
is a new behavior type that is used on watchOS.DeviceSpecificInputSetProvider
no longer requires a UIDevice
.EnglishInputSetProvider
no longer requires UIKit.SystemAudioPlayer
playSystemAudio
has been renamed to play
.UIDevice
-based initializer replaced by a device-agnostic one.This version adds tap behavior to the margin next to character inputs.
KeyboardAction
has a new characterMargin
action.iPadKeyboardLayoutProvider
and iPhoneKeyboardLayoutProvider
now only adjust input sets with three rows.iPhoneKeyboardLayoutProvider
will now add characterMargin
to the empty surrounding space around a character key.Despite the aim described in the release notes, this patch contains deprecations that will only affect devs who create their own system keyboard layouts.
SystemKeyboardLayoutProvider
has new margin action functions.SystemKeyboardLayoutProvider
has been redesigned to let all functions that take multiple parameters with an initial context, place the context parameter last. This gives a cleaner and more harmonized public api.SystemKeyboardLayoutProvider
inputs(for:)
has been renamed to inputRows(for:)
.This version adds new locales and renames a bunch of types, properties and parameters to make things nicer in preparation for 6.0.
This version also harmonizes KeyboardLocale
naming to put the language first and the optional country second. This means that the new Belgian locales are called french_belgium
and dutch_belgium
and brazilian
has been renamed to portuguese_brazil
.
SystemKeyboard
has a new, static standardButtonContent
function.SystemKeyboard
has a new, static standardButtonView
function.SystemKeyboard
now explicitly applies a leftToRight
layout direction.AlphabeticKeyboardInputSet
has been renamed to AlphabeticInputSet
BaseSecondaryCalloutActionProvider
has been renamed to BaseCalloutActionProvider
.CalloutActionProvider
secondaryCalloutActions
has been renamed to calloutActions
.DisabledSecondaryCalloutActionProvider
has been renamed to DisabledCalloutActionProvider
.EnglishKeyboardInputSetProvider
has been renamed to EnglishInputSetProvider
.EnglishSecondaryCalloutActionProvider
has been renamed to EnglishCalloutActionProvider
.KeyboardInput
has been renamed to InputSetItem
.KeyboardInputRow
has been renamed to InputSetRow
.KeyboardInputRows
has been renamed to InputSetRows
.KeyboardInputSet
has been renamed to InputSet
.KeyboardInputSetProvider
has been renamed to InputSetProvider
.KeyboardInputViewController
keyboardInputCalloutContext
has been renamed to inputCalloutContext
.KeyboardInputViewController
keyboardSecondaryInputCalloutContext
has been renamed to actionCalloutContext
.KeyboardInputViewController
keyboardSecondaryCalloutActionProvider
has been renamed to calloutActionContext
.KeyboardLocale
.brazilian
has been renamed to .portuguese_brazil
.LocalizedSecondaryCalloutActionProvider
has been renamed to LocalizedCalloutActionProvider
.NumericKeyboardInputSet
has been renamed to NumericInputSet
PreviewKeyboardInputSetProvider
has been renamed to PreviewInputSetProvider
.PreviewSecondaryCalloutActionProvider
has been renamed to PreviewCalloutActionProvider
.RowItem
has been renamed to KeyboardRowItem
.SecondaryCalloutActionProvider
has been renamed to CalloutActionProvider
.SecondaryInputCalloutContext
has been renamed to ActionCalloutContext
.SecondaryInputCalloutStyle
has been renamed to ActionCalloutStyle
StandardKeyboardInputSetProvider
has been renamed to StandardInputSetProvider
.StandardSecondaryCalloutActionProvider
has been renamed to StandardCalloutActionProvider
.String
isVowel
is deprecated and will be removed in 6.0.SymbolicKeyboardInputSet
has been renamed to SymbolicInputSet
SystemKeyboard
has renamed buttonViewBuilder
to buttonView
and buttonContentBuilder
to buttonContent
.View+secondaryInputCallout
has been renamed to actionCallout
Even though most renamed functions have deprecated variants, open functions that can be overridden will have to be renamed if you have overridden them.
This version adds new locales and improves emoji support.
There are some breaking changes, but they shouldn't affect you if you haven't been customizing emoji keyboards.
Character
has new emoji properties: isEmoji
, isCombinedEmoji
, isSimpleEmoji
.EmojiKeyboardStyle
has renamed and reorganized its parameters.EmojiKeyboardStyle
has a new verticalKeyboardPadding
property.EmojiKeyboardStyle.standardLargePadLandscape
is now mutable.EmojiKeyboardStyle.standardLargePadPortrait
is now mutable.EmojiKeyboardStyle.standardPadLandscape
is now mutable.EmojiKeyboardStyle.standardPadPortrait
is now mutable.EmojiKeyboardStyle.standardPhoneLandscape
is now mutable.EmojiKeyboardStyle.standardPhonePortrait
is now mutable.String
has new emoji properties: containsEmoji
, containsOnlyEmojis
, emojis
, emojiScalars
, emojiString
, isSingleEmoji
.EmojiCategoryStyle
is adjusted to be more correct on iPad devices.EmojiCategoryKeyboard.CategoryTitleViewProvider
now takes a style.EmojiCategoryKeyboardTitle
now takes a style, but will default to .standardPhonePortrait
.KeyboardAction.shift
now uses a lighter color scheme for uppercase.String.wordDelimiters
has been extended with various brackets.SystemKeyboard
now only uppercases for sentence autocapitalization after tapping a space after the sentence delimiter.EmojiCategory
now adds accidentally excluded ๐ตโ๐ซ emoji.SystemKeyboardLayoutProvider
hasXXXAlphabeticInput
properties have been deprecated.EmojiKeyboardButton
has renamed configuration
to style
.EmojiKeyboardStyle
has renamed and reorganized its parameters. There is no deprecations, since the initializer has standard values for each parameter, which cause conflicts.This version adds support for new locales and makes it easier to create and use the SystemKeyboard
.
SystemKeyboard
now automatically renders an EmojiCategoryKeyboard
on iOS 14 and later.SystemKeyboard
has new convenience initializers that just requires a controller
instead of all granular configurations. The controller is auto-resolved to .shared
if none is provided.Thanks to @ardavank and @rawandahmad698, this release adds support for Persian (Farsi), Arabic, Kurdish Sorani and RTL keyboards.
DeviceSpecificInputSetProvider
has new row functions for lower/uppercase characters.Image
has a new .keyboardBackspaceRtl
property and .keyboardBackspace
function.Image
has a new .keyboardNewlineRtl
property and .keyboardBackspace
function.Image
has a new .keyboardZeroWidthSpace
property with a temp arrow icon.KeyboardInputRow
has a new initializer for lower/uppercase characters.KeyboardInputRows
has a new initializer for lower/uppercase characters.String
has new, static carriageReturn
, newline
, space
, tab
and zeroWidthSpace
properties.KeyboardAction+Button
now resolves RTL variants of backspace and newline.KeyboardAction+Button
now resolves the new zeroWidthSpace
character to the new zeroWidthSpace
icon.KeyboardLocale
resolves isLeftToRight
and isRightToLeft
through its derived xยงlocale.DeviceSpecificInputSetProvider
has a bunch of functions that just resolve to KeyboardInputRow
. These are now marked as deprecated to make the type cleaner.