KeyboardKit tries to honor semantic versioning:
- Only deprecate code in
minorversions. - Only remove deprecated code in
majorversions. - Avoid introducing breaking changes in
minorversions.
Breaking changes can still occur in minor versions and patches, though, if the alternative is to not be able to release new critical features or fixes.
This version adds more primary button types.
KeyboardAction.PrimaryTypehas newjoinandcustomcases.KeyboardAction.PrimaryTypenow maps unrepresentedUIReturnKeyTypetypes to the newcustomtype.UIReturnKeyTypehas new extensions for getting thekeyboardActionandprimaryButtonType.
KeyboardGesturesshortens the time it takes for the secondary action callout to be presented.
This version fixes bugs in the Kurdish Sorani keyboard.
- Tapping
"ھ"triggered multiple inserts.
This version fixes bugs in the Kurdish Sorani keyboard.
- Tapping
"ھ"now inserts"ه"for Kurdish Sorani.
This version makes the library build on more platforms and removes old, deprecated code.
- KeyboardKit now supports iOS, iPadOS, macOS, tvOS and watchOS.
ActionCalloutContexthas a new, staticsharedproperty.ActionCalloutContexthas a newverticalOffsetthat can be used to move the callout up and down.AudioFeedbackConfigurationis now mutable.HapticFeedbackConfigurationis now mutable.InputCalloutContexthas a new, staticsharedproperty.KeyboardInputViewControllerhas a newdidMoveToParentproperty, which is used to avoid callingneedsInputModeSwitchKeywhen it generates a warning.
- Autocomplete now only applies autocorrections for pure
spaceactions and not character actions with a single space. ActionCalloutuses the newActionCalloutContextverticalOffsetto offset the callout bubble.ActionCalloutContextapplies a vertical offset to iPad devices, and adjust the demo toolbar to be 50 on iPad as well.StandardKeyboardBehaviornow has a 0.5 double tap threshold instead of 0.2, and also handles caps lock better.StandardKeyboardFeedbackHandlernow triggers the haptic feedback for long press on space, not theSpaceCursorDragGestureHandler.SystemKeyboardinitializers now usenilas default value for the controller and width, to avoid Swift errors in binary framework builds.
UITextDocumentProxyisCursorAtNewSentenceWithSpacehas been adjusted to handle non-empty space content.
-
All previously deprecated code has been removed.
-
ActionCalloutContextverticalOffsethas been moved toActionCalloutStyle. -
BundleisExtensionhas been made internal. -
Color.standardButtonBackgroundColor(for:)has been renamed tostandardButtonBackground(for:). -
Color.standardButtonForegroundColor(for:)has been renamed tostandardButtonForeground(for:). -
Color.standardButtonShadowColor(for:)has been renamed tostandardButtonShadow(for:). -
Color.standardDarkButtonBackgroundColor(for:)has been renamed tostandardDarkButtonBackground(for:). -
Color.standardDarkButtonForegroundColor(for:)has been renamed tostandardDarkButtonForeground(for:). -
KeyboardActionisKeyboardTypehas been removed. -
KeyboardActionisSpacehas been removed. -
KeyboardActionstandardTextDocumentProxyInputActionhas been merged withstandardTextDocumentProxyAction. -
KeyboardAppearancesystemKeyboardButtonStyle(for:)has been renamed tobuttonStyle(for:). -
KeyboardFeedbackHandlerno longer has any action provider-based logic and no typealiases. -
KeyboardInputViewControllerneedsInputModeSwitchKeyOverridehas been removed. -
StandardKeyboardActionHandlerGestureActionhas been removed. -
StandardKeyboardFeedbackHandlertriggerFeedbackForLongPressOnSpaceDragGesturehas been removed. -
StandardKeyboardFeedbackHandlershouldTriggerFeedbackhas been moved toStandardKeyboardActionHandler. -
SystemKeyboardButtonStylehas been renamed toKeyboardButtonStyle. -
SystemKeyboardButtonBorderStylehas been renamed toKeyboardButtonBorderStyle. -
SystemKeyboardButtonShadowStylehas been renamed toKeyboardButtonShadowStyle.
This version adjust orientation change handling further.
KeyboardInputViewControllernow wraps the context sync in aDispatchQueue.main.asyncblock. This seems to improve the behavior quite a bit.
This version adjust orientation change handling further.
KeyboardInputViewControllerre-adds sync for layout change, but only once afterviewDidLayoutSubviewsif orientation changes.
This version polishes the action callout on iPad further and fixes a layout bug.
ActionCalloutContexthas a newverticalOffsetproperty.
ActionCalloutis now pushed down a bit on iPad devices.KeyboardInputViewControllerno longer syncs context onviewWillLayoutSubviews.
KeyboardInputViewControllercould get stuck in a loop due to syncing context inviewWillLayoutSubviews.
This version polishes the action callout on iPad and makes the core library build on macOS.
- This version makes the core library build on macOS. KeyboardKit Pro will add macOS support in 6.0.
ActionCalloutStylehas a newmaxButtonSizeproperty.
ActionCalloutnow renders differently on iPad devices.ActionCalloutContextnow requires a little less swiping to change action.
This version adds new locales and makes the library build on more platforms.
- This version makes the library build on tvOS and watchOS.
- 🇧🇬 Bulgarian
- 🇦🇩 Catalan
- 🇫🇴 Faroese
- 🇵🇭 Filipino
- 🇬🇪 Georgian
- 🇲🇰 Macedonian
- 🇲🇹 Maltese
- 🇲🇳 Mongolian
- 🇷🇸 Serbian
- 🇷🇸 Serbian (Latin)
- 🇸🇰 Slovak
DeviceSpecificInputSetProviderhas new row functions.DeviceTypeis a new enum that can be used to determine device type without having to use the real platform-specific device type.DisabledHapticFeedbackPlayeris a new feedback player that is used on tvOS and watchOS.InputSetProviderhas new row functions.StandardHapticFeedbackPlayeris now open to subclassing.StandardKeyboardLayoutProviderhas a newfallbackProviderthat is used when device is not iPhone or iPad.StandardSystemAudioPlayeris now open to subclassing.StaticKeyboardBehavioris a new behavior type that is used on watchOS.
DeviceSpecificInputSetProviderno longer requires aUIDevice.EnglishInputSetProviderno longer requires UIKit.- The iPhone and iPad keyboard layout provides have been adjusted to provide better layouts.
- Some iPad incorrect layouts have been adjusted.
SystemAudioPlayerplaySystemAudiohas been renamed toplay.- All input set providers have the
UIDevice-based initializer replaced by a device-agnostic one.
This version fixes an iPad layout bug that was introduced by 5.8.1.
This version adds tap behavior to the margin next to character inputs.
KeyboardActionhas a newcharacterMarginaction.
iPadKeyboardLayoutProviderandiPhoneKeyboardLayoutProvidernow only adjust input sets with three rows.iPhoneKeyboardLayoutProviderwill now addcharacterMarginto the empty surrounding space around a character key.
Despite the aim described in the release notes header, this patch contains some deprecations, that will only affect devs who create their own system keyboard layouts.
SystemKeyboardLayoutProviderhas new margin action functions.SystemKeyboardLayoutProviderhas 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.SystemKeyboardLayoutProviderinputs(for:)has been renamed toinputRows(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.
- 🇭🇷 Croatian
- 🇧🇪 Dutch (Belgium)
- 🇧🇪 French (Belgium)
- 🇨🇭 French (Switzerland)
- 🇦🇹 German (Austria)
- 🇨🇭 German (Switzerland)
- 🇬🇷 Greek
- 🇭🇺 Hungarian
- 🇸🇮 Slovenian
SystemKeyboardhas a new, staticstandardButtonContentfunction.SystemKeyboardhas a new, staticstandardButtonViewfunction.
SystemKeyboardnow explicitly applies aleftToRightlayout direction.
AlphabeticKeyboardInputSethas been renamed toAlphabeticInputSetBaseSecondaryCalloutActionProviderhas been renamed toBaseCalloutActionProvider.CalloutActionProvidersecondaryCalloutActionshas been renamed tocalloutActions.DisabledSecondaryCalloutActionProviderhas been renamed toDisabledCalloutActionProvider.EnglishKeyboardInputSetProviderhas been renamed toEnglishInputSetProvider.EnglishSecondaryCalloutActionProviderhas been renamed toEnglishCalloutActionProvider.KeyboardInputhas been renamed toInputSetItem.KeyboardInputRowhas been renamed toInputSetRow.KeyboardInputRowshas been renamed toInputSetRows.KeyboardInputSethas been renamed toInputSet.KeyboardInputSetProviderhas been renamed toInputSetProvider.KeyboardInputViewControllerkeyboardInputCalloutContexthas been renamed toinputCalloutContext.KeyboardInputViewControllerkeyboardSecondaryInputCalloutContexthas been renamed toactionCalloutContext.KeyboardInputViewControllerkeyboardSecondaryCalloutActionProviderhas been renamed tocalloutActionContext.KeyboardLocale.brazilianhas been renamed to.portuguese_brazil.LocalizedSecondaryCalloutActionProviderhas been renamed toLocalizedCalloutActionProvider.NumericKeyboardInputSethas been renamed toNumericInputSetPreviewKeyboardInputSetProviderhas been renamed toPreviewInputSetProvider.PreviewSecondaryCalloutActionProviderhas been renamed toPreviewCalloutActionProvider.RowItemhas been renamed toKeyboardRowItem.SecondaryCalloutActionProviderhas been renamed toCalloutActionProvider.SecondaryInputCalloutContexthas been renamed toActionCalloutContext.SecondaryInputCalloutStylehas been renamed toActionCalloutStyleStandardKeyboardInputSetProviderhas been renamed toStandardInputSetProvider.StandardSecondaryCalloutActionProviderhas been renamed toStandardCalloutActionProvider.StringisVowelis deprecated and will be removed in 6.0.SymbolicKeyboardInputSethas been renamed toSymbolicInputSetSystemKeyboardhas renamedbuttonViewBuildertobuttonViewandbuttonContentBuildertobuttonContent.View+secondaryInputCallouthas been renamed toactionCallout
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.
- 🇧🇾 Belarusian
- 🇨🇿 Czech
- 🇷🇴 Romanian
Characterhas new emoji properties:isEmoji,isCombinedEmoji,isSimpleEmoji.EmojiKeyboardStylehas renamed and reorganized its parameters.EmojiKeyboardStylehas a newverticalKeyboardPaddingproperty.EmojiKeyboardStyle.standardLargePadLandscapeis now mutable.EmojiKeyboardStyle.standardLargePadPortraitis now mutable.EmojiKeyboardStyle.standardPadLandscapeis now mutable.EmojiKeyboardStyle.standardPadPortraitis now mutable.EmojiKeyboardStyle.standardPhoneLandscapeis now mutable.EmojiKeyboardStyle.standardPhonePortraitis now mutable.Stringhas new emoji properties:containsEmoji,containsOnlyEmojis,emojis,emojiScalars,emojiString,isSingleEmoji.
EmojiCategoryStyleis adjusted to be more correct on iPad devices.EmojiCategoryKeyboard.CategoryTitleViewProvidernow takes a style.EmojiCategoryKeyboardTitlenow takes a style, but will default to.standardPhonePortrait.KeyboardAction.shiftnow uses a lighter color scheme for uppercase.String.wordDelimitershas been extended with various brackets.SystemKeyboardnow only uppercases for sentence autocapitalization after tapping a space after the sentence delimiter.- Several iPad layouts has adjusted the lower-right keys for numeric keyboards, to have
,and.on the alphabetic keyboard and!and?on the numeric and symbolic. This is because these symbols currently don't adjust for uppercase and there is no swipe down support.
EmojiCategorynow adds accidentally excluded 😵💫 emoji.
- A bunch of
SystemKeyboardLayoutProviderhasXXXAlphabeticInputproperties have been deprecated.
EmojiKeyboardButtonhas renamedconfigurationtostyle.EmojiKeyboardStylehas 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.
- 🇮🇪 Irish
- 🇵🇹 Portuguese
- 🇧🇷 Portuguese (Brazil)
- 🇹🇷 Turkish
SystemKeyboardnow automatically renders anEmojiCategoryKeyboardon iOS 14 and later.SystemKeyboardhas new convenience initializers that just requires acontrollerinstead of all granular configurations. The controller is auto-resolved to.sharedif none is provided.
Thanks to @ardavank and @rawandahmad698, this release adds support for Persian (Farsi), Arabic, Kurdish Sorani and RTL keyboards.
- 🇦🇪 Arabic
- 🇹🇯 Kurdish Sorani
- 🇮🇷 Persian
DeviceSpecificInputSetProviderhas new row functions for lower/uppercase characters.Imagehas a new.keyboardBackspaceRtlproperty and.keyboardBackspacefunction.Imagehas a new.keyboardNewlineRtlproperty and.keyboardBackspacefunction.Imagehas a new.keyboardZeroWidthSpaceproperty with a temp arrow icon.KeyboardInputRowhas a new initializer for lower/uppercase characters.KeyboardInputRowshas a new initializer for lower/uppercase characters.Stringhas new, staticcarriageReturn,newline,space,tabandzeroWidthSpaceproperties.
KeyboardAction+Buttonnow resolves RTL variants of backspace and newline.KeyboardAction+Buttonnow resolves the newzeroWidthSpacecharacter to the newzeroWidthSpaceicon.KeyboardLocaleresolvesisLeftToRightandisRightToLeftthrough its derived x§locale.
DeviceSpecificInputSetProviderhas a bunch of functions that just resolve toKeyboardInputRow. These are now marked as deprecated to make the type cleaner.
This release fixes issues with EmojiKeyboard and EmojiCategoryKeyboard.
The internal EmojiKeyboardItem that created unique IDs caused the emojis to constantly re-render. It has been removed.
Note that this change now requires emojis to be unique within a certain keyboard.
More styles now have var properties instead of lets, which means that it's easy to create and change a mutable copy of a style.
AutocompleteToolbarStyleare now vars instead of lets.AutocompleteToolbarItemStyleare now vars instead of lets.AutocompleteToolbarItemBackgroundStyleare now vars instead of lets.AutocompleteToolbarSeparatorStyleare now vars instead of lets.EmojiKeyboardStyleare now vars instead of lets.EmojiKeyboardStylenow has newabcTextandbackspaceIconwhich will be used in the next minor version to make category views no longer require appearance.
EmojiCategoryKeyboardnow resets scroll offset when changing category.EmojiCategoryKeyboardnow persists category changes right away instead of when disappearing.EmojiKeyboardno longer generates unique IDs for each emoji, which improves performance.EmojiKeyboardStylenow uses the primary color instead of black to make highlighting show in dark mode.
Thanks to @digitalheir, this release removes the need for using AnyView in many places.
Thanks to @danielpunkass, this release makes it possible to use the library within an app target.
This version also adds missing emojis.
- 🥸😶🌫️😮💨🤌🤏🦾🦶🦵🦿🦷👣🫀🫁🫂👩🦱🧑🦱👨🦱👩🦰🧑🦰👨🦰👱🧑🦳👨🦳👩🦲🧑🦲👨🦲🧔♀️
🧔♂️👳👮👷💂🕵️🧑⚕️🧑🌾🧑🍳🧑🎓🧑🎤🧑🏫🧑🏭🧑💻🧑💼🧑🔧🧑🔬🧑🎨🧑🚒👨🚒👩
✈️ 🧑✈️ 🧑🚀🧑⚖️👰♀️👰♂️🤵♀️ 🤵♂️🦸♀️🦸🦸♂️🦹♀️🦹🦹♂️🧑🎄🧙🧝🧛🧟🧞🧞♂️🧜🧚👩🍼🧑🍼👨🍼🙇💁🙅🙆🙋🧏♀️🧏🧏♂️ 🤦🤷🙎🙍💇💆🧖👯👩🦽🧑🦽👨🦽👩🦼🧑🦼👨🦼🚶👩🦯🧑🦯👨🦯🧎♀️🧎🧎♂️🏃🧍♀️🧍🧍♂️👩❤️👨👩❤️💋👨 👨👩👦👨👩👦👦🪢🧶🧵🪡🥼🦺👕🩲🩳🩱🥻🩴🥿👟🥾🧣🎩🪖🧳🥽 - 🐻❄️🪱🪰🪲🪳🦟🦞🦭🦧🦣🦛🦘🦬🦙🦮🐕🦺🐈⬛🪶🦤🦚🦜🦢🦩🦝🦨🦡🦫 🦦🦥🪵🪴🪨🪐
- 🫐🥭🥬🫑🫒🧄🧅🥯🧈🧇🦴🫓🧆🫔🫕🦪🥮🧁🫖🧃🧋🧉🧊🧂
- 🥎🥏🪀🥍🪃🪁🤿🛹🛼🪂🏋️🤼🤸⛹️🤾🏌️🧘🏄🏊🤽🚣🧗🏻🚵🚴🤹🩰🪘 🪗🪕♟🧩
- 🛻🦯🦽🦼🛺🪝🛖🛕
- 🧭🪔🧯🪙🪜🧰🪛🪚🪤🧱🧲🧨🪓🪦🧿🩹🩺🩸🧬🦠🧫🧪🧹🪠🧺🧻🧼 🪥🪒🧽🪣🧴🪑🧸🪆🪞🪟🪄🪅🧧🪧🧾🗑🧷🧮
- 🤍🤎❤️🔥❤️🩹⚧♾👁🗨🟠🟡🟢🟣🟥🟧🟨🟩🟦🟪🟫
- 🏴☠️🏳️⚧️🇺🇳🇻🇮
Bundlehas newisExtensionextension property.Localehas newlocalizedNameextension property.StandardSystemKeyboardButtonViewis a new typealias that defines the standard system keyboard button view.StandardSystemKeyboardButtonContentis a new typealias that defines the standard system keyboard button content.SystemKeyboardhas a new, staticstandardKeyboardWidth.Viewhas new, genericlocaleContextMenuextensions that can be used to create custom locale context menus.
AutocompleteToolbaris now generic.EmojiKeyboardis now generic.SystemKeyboardis now generic.SystemKeyboardSpaceButtonContentis now generic.
KeyboardActionRowis the same thing asKeyboardActionsand wasn't used in the library.KeyboardLayoutitemsinitializer has been replaced with anitemRowsinitializer.KeyboardLayoutitemhas been replaced withitemRows.- The old
AnyView-based initializers have been replaced with the new, generic initializers.
Although we aimed to implement the new generic views with no breaking changes, there may be some that slipped us by.
- 🇦🇱 Albanian
- 🇮🇸 Icelandic
- 🇵🇱 Polish
CGSizedevice dimension properties are now public:- iPadProLargeScreenPortrait
- iPadProLargeScreenLandscape
- iPadProSmallScreenPortrait
- iPadProSmallScreenLandscape
- iPadScreenPortrait
- iPadScreenLandscape
- iPhoneProMaxScreenPortrait
- iPhoneProMaxScreenLandscape
- isScreenSize(...)
EmojiKeyboardButtonis a new view that renders a standard emoji keyboard button.EmojiCategoryTitleis a new view that renders a standard emoji category title.KeyboardFeedbackSettingshas new properties and functions:- isAudio/HapticFeedbackEnabled
- disableAudio/HapticFeedback()
- enableAudio/HapticFeedback()
- toggleAudio/HapticFeedback()
KeyboardTextFieldhas a newplaceholderproperty.Stringhas newvowelsandisVowelextension properties.
AudioFeedbackToggleButtonis a new view that can be used to toggle audio feedback on and off.EnabledLabelis a new view that can be used to show different views depending on a provided enabled state.HapticFeedbackToggleButtonis a new view that can be used to toggle haptic feedback on and off.KeyboardActiveLabelis a new view that can be used to present whether or not a keyboard extension is currently being used to edit a text field.KeyboardEnabledLabelis a new view that can be used to present whether or not a keyboard extension is enabled in System Settings.Licensenow implementsCodableand has a public initializer, as well as newtierandadditionalInfoproperties.LicenseCustomernow implementsCodableand has a public initializer, as well as a newadditionalInfoproperty.LicenseTieris a new type that defines the level of service for your specific license.ToggleToolbaris a new view that can be used to toggle between two toolbars.
- Typing an alternate quotation delimiter (`, ´, etc.) now switches back to the alphabetic keyboard.
- The Finnish iPad input set provider has been corrected for numeric and symbolic inputs.
EmojiCategory.frequentnow uses the frequent provider to resolve its emojis.EmojiCategoryKeyboardMenunow shows the "frequent" category once more.EmojiCategoryKeyboardMenuhas reduced circle padding to avoid clipping on smaller screens.
KeyboardKitLicensehas been renamed toLicense.KeyboardKitLicense+Customerhas been converted to a typealias forLicenseCustomerand has been deprecated.
This version adds support for Russian and Ukrainian and bumps the package's Swift version to 5.5 to enable DocC support.
By adding DocC support, the documentation has been updated to allow for topics, cross-linking etc. You can download the documentation from the project website or find a zipped version in the Docs folder.
- 🇷🇺 Russian
- 🇺🇦 Ukrainian
- This version corrects the system button highlight color in dark mode.
This version adds support for estonian, latvian and lithuanian.
This version also adds new inspection capabilities and fixes some bugs.
- 🇪🇪 Estonian
- 🇱🇻 Latvian
- 🇱🇹 Lithuanian
UITextDocumentProxyhas a newhasCurrentWordproperty.InputCallouthas a newcalloutPaddingproperty.KeyboardEnabledStatehas a newisKeyboardCurrentlyActiveproperty.KeyboardEnabledStateInspectorhas a newisFullAccessEnabledproperty.KeyboardEnabledStateInspectorhas a newisKeyboardCurrentlyActivefunction.
InputCalloutnow calculates a minimum callout width based on button size, curve size etc.InputCalloutnow applies a minimum callout size instead of a fixed one, which means that the callout content can be larger.
InputCalloutwas rendered too wide by default, when used inSystemKeyboard. This has been fixed.SecondaryInputCalloutapplied an incorrect leading corner radius. This has been fixed.
KeyboardKit 5.0 streamlines the library, improves styling and previewing and makes the library easier to use.
This version also removes all UIKit-specific functionality as well as all previously deprecated functionality.
This version also adjust keyboard button sizes to be more correct on more device types, e.g. iPhone Pro Max, iPad Pro etc.
KeyboardKit 5.0 requires Xcode 13 and Swift 5.5.
-
Library types now implement protocols like
CodableandIdentifiableto greater extent. -
Library views have a lot more previews than before, which make them much easier to adjust.
-
Library views no longer depend on environment objects, which make them easier to create and use.
-
AudioFeedbackConfigurationhas a new action-specific feedback list. -
AudioFeedbackConfigurationhas a new, staticenabledconfiguration. -
AutocompleteContexthas a newisLoadingproperty. -
AutocompleteToolbarItemSubtitleis a new view that renders autocomplete subtitles. -
Collection+RowItemhas new extensions to affect all rows. -
EdgeInsetshas a newinit(all:)initializer. -
EdgeInsetshas a newinit(horizontal:,vertical:)initializer. -
EmojiCategoryhas a newemojisStringproperty. -
EmojiKeyboardStylehas newsystemFontandselectedCategoryColorproperties. -
HapticFeedbackConfigurationhas a new action-specific feedback list. -
HapticFeedbackConfigurationhas a new, staticenabledconfiguration. -
InputCalloutContexthas a new, static.disabledcontext. -
KeyboardActionhas a newinputCalloutTextproperty. -
KeyboardActionhas a newisCharacterActionproperty. -
KeyboardAppearancehas a newinputCalloutStyle()function. -
KeyboardAppearancehas a newsecondaryInputCalloutStyle()function. -
KeyboardContexthas a newscreenproperty. -
KeyboardInputTextComponentis now public. -
KeyboardLayoutConfigurationis a new type that replaces theCGFloatandUIEdgeInsetsextensions. -
KeyboardLayoutConfigurationhas a bunch of standard layout configs for different devices. -
NextKeyboardButtonis now SwiftUI-based and don't require any special setup. -
Previewservices have new, static.previewprotocol properties. -
SecondaryInputCalloutContexthas a new, static.disabledcontext. -
StandardHapticFeedbackPlayerhas a newsharedplayer. -
StandardKeyboardFeedbackHandlernow prefers action-specific feedback, if defined. -
StandardSystemAudioPlayerhas a newsharedplayer. -
SystemKeyboardActionButtonis a new view that makes it easy to create action-based keyboard buttons. -
SystemKeyboardButtonis a new view that makes it easy to create standalone keyboard buttons. -
SystemKeyboardButtonTextis a new view that just sets up text correctly. -
SystemKeyboardSpaceButtoncan now wrap any content. -
View+Callouthas a newcalloutShadowextension.
AutocompleteToolbarStyleis a new style that can style autocomplete toolbars.AutocompleteToolbarItemStyleis a new style that can style autocomplete toolbar items.AutocompleteToolbarItemBackgroundStyleis a new style that can style the autocomplete highlight.AutocompleteToolbarSeparatorStyleis a new style that can style autocomplete toolbar separators.CalloutStylehas a new, static.standardstyle.InputCalloutStylehas a new, static.standardstyle.SecondaryInputCalloutStylehas a new, static.standardstyle.SystemKeyboardButtonBorderStylehas a new, static.standardstyle.SystemKeyboardButtonShadowStylehas a new, static.standardstyle.SystemKeyboardButtonShadowStylehas new, default init parameter values.
AutocompleteToolbarnow applies the autocomplete background instead of the item view.AutocompleteToolbarItem's standard item builder now renders a subtitle if the suggestion has one.InputCalloutandSecondaryInputCalloutlook more like the native callouts.KeyboardAction+Buttonnow returnsKKL10n.spacefor.spaceaction.KeyboardGesturesnow resolves input contexts from the shared controller, instead of using environment objects.StandardKeyboardAppearanceuses a small transparency to make standard buttons bleed through the underlying vibrancy.SystemKeyboarduses the new callout styles in the appearance.SystemKeyboardActionButtonContentnow returns aSystemKeyboardSpaceButtonContentfor.space.SystemKeyboardButtonContentnow uses appearance for both text and image logic.SystemKeyboardButtonContentno longer applies RTL transforms on the image, since SF symbols do this automatically.SystemKeyboardButtonStylenow applies a standard shadow style by default.SystemKeyboardSpaceButtonContentno longer auto-resolves texts, but instead show just what you provide it with.SystemKeyboardSpaceButtonnow takes up as much horizontal space as it can.
InputCalloutandSecondaryInputCalloutno longer get tear lines in some apps.SystemKeyboardActionButtonnow handles the.nextKeyboardaction correctly.
-
All deprecated functionality has been removed.
-
All UIKit-specific functionality has been removed.
-
Library views that no longer depend on environment objects, may require more init parameters.
-
Initializer argument changes are omitted in the list below.
-
AutocompleteProviderignoredWordsis now read-only. -
AutocompleteResponsehas been renamed toAutocompleteCompletion. -
AutocompleteToolbarItemTexthas been renamed toAutocompleteToolbarItemTitle. -
AudioFeedbackhas been renamed toSystemAudio. -
BaseSecondaryCalloutActionProvider's init is now throwing. -
CalloutStylebuttonOverlayInsethas been renamed tobuttonInset. -
CGFloat+Keyboardhas been replaced withKeyboardLayoutConfiguration. -
ColorclearInteractablehas been made as internal and will be removed over time. -
EdgeInsets+Keyboardhas been replaced withKeyboardLayoutConfiguration. -
EmojiKeyboardbutton builder no longer takes a context. -
EmojiKeyboardConfigurationhas been renamed toEmojiKeyboardStyle -
HapticFeedbackprepareandtriggernow only has a non-static version. -
HapticFeedback.playerhas been removed. -
InputCalloutContextbuttonFrame(for:)has been removed. -
InputCalloutContextupdateInput(for:geo:)has been renamed toupdateInput(for:,in:). -
KeyboardAction+Buttonstyles have been moved intoStandardKeyboardAppearance. -
KeyboardBehaviorhas a newshouldSwitchToCapsLockfunction. -
KeyboardCasing.neutralhas been removed. -
KeyboardEnabledStateInspectorisKeyboardEnabledforparameters has been renamed towithBundleId. -
KeyboardInputSetProviderfunctions have been converted to properties. -
KeyboardType.customhas been renamed toKeyboardType.custom(named:). -
SecondaryInputCalloutContextalignmentis now aHorizontalAlignment. -
SecondaryInputCalloutContextbuttonFrame(for:)has been removed. -
SecondaryInputCalloutContextupdateInputs(for:geo:alignment)has been renamed toupdateInputs(for:in:alignment:). -
SecondaryInputCalloutStyleselectedTextColorhas been renamed toselectedForegroundColor. -
SecondaryInputCalloutStyleverticalPaddinghas been renamed toverticalTextPadding. -
Sequencebatched(withBatchSize:)has been renamed tobatched(into:). -
SpaceDragSensitivity.customhas been renamed tocustom(points:). -
SystemAudiosystemIdhas been renamed toid. -
SystemAudiotriggerhas been renamed toplay. -
SystemAudioplaynow only has a non-static version. -
SystemAudio.playeris nowSystemAudioPlayer.shared. -
SystemAudioPlayernow takesSystemAudioas argument. -
SystemKeyboardButtonhas been renamed toSystemKeyboardActionButton. -
SystemKeyboardButtonContenthas been renamed toSystemKeyboardActionButtonContent. -
SystemKeyboardButtonRowItemnow requires an injectedcontext. -
SystemKeyboardLayoutProviderhasElevenElevenSevenAlphabeticInputis now computed instead of lazy. -
Toasthas been removed. -
UITextDocumentProxydeleteBackwardwith range has been renamed todeleteBackward(range:) -
View+DynamicTypehas been removed. -
View+Autocompletehas been removed. -
View+Calloutis now internal. -
View+DynamicTypehas been removed.
PreviewKeyboardAppearancehas been made public.
This version renames images to avoid preview problems in apps that define the same image names.
- A bunch of images have been renamed with a
keyboardname prefix.
This version fixes the iOS 15 autorotate bug and adds a property that can suppress the needsInputModeSwitchKey warning.
KeyboardInputViewControllerhas a newviewWillSetupKeyboardfunction that can be overridden to setup the keyboard at the proper time. It's just a convenience function. You can still setup the keyboard whenever you want.KeyboardInputViewControllerhas a new, staticneedsInputModeSwitchKeyOverridethat can be set to make all input controllers ignore the real value. This can be useful when you want to create a keyboard preview and don't want all the warnings.KeyboardInputViewControllerhas a newneedsInputModeSwitchKeyOverridethat can be set to make an input controllers ignore the real value. It will default to the static property value.
KeyboardInputViewControllersetup(with:)stack view variant is deprecated and will be removed in 5.0.
This version adds styles, which makes it a lot easier to style system keyboards.
It also exposes more system keyboard views and styles publicly.
Starting with this version, the library will start deprecating stuff that willbe changed in KK 5. The aim is to release several patches to prepare the library for the changes to come through deprecations instead of breaking changes.
KeyboardAppearancehas a newsystemKeyboardButtonStylefunction.NextKeyboardButtonhas an iOS 14 exclusiveColor-based initializer that is now used bySystemKeyboardButtonContentSystemKeyboardButtonBodyis a new view that represents the body of a system keyboard button.SystemKeyboardButtonShadowis a new view that represents the shadow of a system keyboard button.SystemKeyboardButtonStyleis a new style that can be used to define a system keyboard button style.SystemKeyboardButtonBorderStyleis a new style that can be used to define a system keyboard button border.SystemKeyboardButtonShadowStyleis a new style that can be used to define a system keyboard button shadow.TextInputProxynow implementsUITextInputTraitsas well.View+systemKeyboardButtonStyleview extension now taes a style instead of an apperance, action and isPressed bool.
- Thanks to @ardavank, the
EmojisCategoryKeyboardMenunow uses fixed fonts. SystemKeyboardButtonContentnow applies the appearance text color to the "next keyboard" button (on iOS 14+).
AutocompleteSuggestionProviderhas been renamed toAutocompleteProvider.KeyboardAppearancehas deprecated all functions that now can be fetched from the newsystemKeyboardButtonStylestyle.KeyboardInputViewControllerautocompleteSuggestionProviderhas been renamed toautocompleteProvider.View+keyboardButtonStylehas been replaced withView+systemKeyboardButtonStyle.
- More system keyboard views require an explicit appearance to be injected.
- The
AutocompleteSuggestionProviderautocompleteSuggestionsis now escaping.
This versions adds new colors, such as the new standard keyboard background colors, which you can use to mimic keyboard backgrounds.
There are other new colors as well, that are used to work around the iOS color scheme bug, described here and in the docs.
This makes it possible for us to finally workaround the dark mode color bug, and let the system keyboard look as the system keyboard in both dark mode and dark appearance keyboards.
Finally, the dark appearance colors have been renamed and their old names deprecated.
KeyboardLocaleis nowCodable.KeyboardColorhas new colors.Color+Keyboardhas new colors..standardButtonBackgroundForColorSchemeBugis a new color scheme bug color..standardDarkButtonBackgroundForColorSchemeBugis a new color scheme bug color.
- The standard keyboard apperance now uses the new color scheme bug colors, which should make the keyboards look more like the standard ones in dark mode and for dark appearance keyboards.
CalloutStyle.standardnow uses the look ofsystemStyle, since that IS the standard. The system styles have been deprecated.SystemKeyboarduses the new standard callout styles.
InputCalloutnow applies the provided style's callout text color.SecondaryInputCalloutnow uses the provided style's callout text color.View+Buttonnow applies shadows in a way that doesn't affect the button content.SystemKeyboardnow looks closer to the iOS system keyboards, in both dark mode and dark appearance.
- Color extensions for the button background colors are now suffixed with
Background. - Color extensions for the button tints colors are now suffixed with
Foregroundinstead ofTint. - Color extensions with the name
standardDarkAppearance*have been renamed tostandard*ForDarkAppearance. CalloutStyle.systemStyle,InputCalloutStyle.systemStyleandSecondaryInputCalloutStyle.systemStyleare deprecated.
KeyboardColor's dark appearance cases have been renamed to keep things tight.SecondaryInputCalloutStyle's text color property has been removed. Use the callout style's text color instead.
- Thanks to @AntoineBache,
KeyboardTextFieldandKeyboardTextViewno longer resize if their text content gets to wide.
Color.darkAppearanceStrategyis a new, temporary property that lets you inject a custom strategy that controls whether or not to apply a dark appearance color scheme to your keyboard. This lets you work around the current color scheme bug that is described inColor+Button.swiftand override the standard strategy of always applying dark apperance colors when the keyboard context'scolorSchemeis.dark.
If you find a way to determine this correctly and to work around the system behavior, please share your findings.
This version makes KeyboardKit compile for Xcode 13.0 beta 3.
From now, all new versions of KeyboardKit will support the latest Xcode version.
CGFloat+KeyboardandEdgeInsets+Keyboardnow uses the shared vc instead of the shared application.
SystemKeyboardButtonhas a newcontentConfiginit param that allows you to modify the button content before wrapping it in a style and applying gestures.
KeyboardAction.primaryno longer applies autocomplete by default, which solves e.g. autocomplete suggestions being applied in the Safari address bar.
KeyboardTextFieldandKeyboardTextViewnow accepts a text binding, so that you can access the typed text.
KeyboardTextFieldandKeyboardTextViewnow share functionality through a new protocol.
- Thanks to @junyng, deleting backwards now works even when
documentContextBeforeInputis nil.
KeyboardTextFieldandKeyboardTextViewnow requires a text binding.
This version adjusts the colors that are used for dark keyboard appearance and dark mode keyboards, to make keyboards look better in dark appearance when in light mode.
The problem is discussed here.
This fix makes the button a little brighter in dark mode, but that's a lot better than having them be a little darker in dark appearance light mode.
This version fixes a bug that caused the keyboard type to not change when typing into a TextInputProxy text field.
This version adds features that makes it possible to add text fields and text views to the keyboard extension and automatically redirect keyboard events there instead of using the hosting app.
You can either set KeyboardInputViewController.shared.textInputProxy directly, or use the new KeyboardTextField and KeyboardTextView views that does this automatically.
- There is a new
Proxynamespace to which theUITextDocumentProxyextensions have been moved. KeyboardInputViewControllerhas a newtextInputProxythat can be set to redirect the keyboard to that proxy instead of the originaltextDocumentProxy.KeyboardTextFieldandKeyboardTextVieware two new views that can be used in keyboard extensions and that will automatically redirect keyboard events to them when they become first responder.TextInputProxyis a new class that can be used to redirect the keyboard events to any text input.
- This version fixes a gesture bug that caused the space tap action to be triggered even after long pressing and dragging the cursor around.
KeyboardInputViewControllerviewWillSyncWithTextDocumentProxywas not used internally and has been removed. If you override this in your own keyboards, just overrideviewWillAppearinstead.
ibayramli2001andamirshanehave fixed a crash when deleting backwards without any content in the proxy.
KeyboardCasinghas a newautocase.
SystemKeyboardLayoutProvideruses the newautocase for numeric and symbolic keyboard type switches.
- This version fixes a bug that caused numeric and symbolid keyboards to always switch back to lowercased alphabetic keyboards.
BaseKeyboardLayoutProviderhas been renamed toSystemKeyboardLayoutProvider.KeyboardCasing.neutralis deprecated and will be removed.
StandardKeyboardActionHandlercanHandleis nowopeninstead ofpublic.
KeyboardGesturesnow use the drag gesture to trigger tap actions instead of a tap gesture. This increases responsiveness and ensures that taps aren't cancelled when you press for too long.KeyboardGesturesnow only applies a double tap gesture if a double tap action is provided.- The changes above helps reducing the number of active gestures and reduces the overall gesture complexity.
- This version fixes compile errors in Xcode 12.4.
Image.settingshas been renamed tokeyboardSettings.Image.moveCursorLeft/Righthave been renamed tokeyboardLeft/Right.
This version fixes a bug that caused the keyboard layout to not update.
This version fixes a bug that caused the secondary actions to not update.
This version adds new locales, external keyboard detection, dynamic type disabling and RTL locale support.
- 🇫🇷 French
- 🇪🇸 Spanish
ExternalKeyboardContextis a new iOS 14 exclusive class that lets you observe whether or not an external keyboard is connected to the device.KeyboardActionhas a newstandardButtonFontSizefunction.KeyboardTypehas a new, context-basedstandardButtonImagefunction that replaces the old property.KeyboardLocalehas newisLeftToRightandisRightToLeftproperties.KeyboardTypehas a newstandardButtonFontSizefunction.KeyboardTypehas a new, context-basedstandardButtonTextfunction that replaces the old property.Localehas newcharacterDirectionandlineDirectionproperties.Localehas newisLeftToRight,isRightToLeft,isBottomToTop,isTopToBottomproperties.- Thanks to @habaieba, KeyboardKit now has French localization.
- There are new localizations for the keyboard type key texts.
KeyboardActionnow flips the standard keyboard button image for RTL locales.SystemKeyboardwill now ignore dynamic type, just like the native keyboards.
- The German localized newline symbol for Return is now correctly rendered as an image.
KeyboardActionstandardButtonFonthas been renamed tostandardButtonUIFont.KeyboardActionstandardButtonFontWeighthas been renamed tostandardButtonUIFontWeight.KeyboardActionstandardButtonImagehas been converted to a context-based function.KeyboardTypestandardButtonTexthas been converted to a context-based function.UIApplicationstandardButtonTextStylehas been renamed tostandardButtonUITextStyle.
KeyboardAction+standardButtonFontnow returns aFontinstead of aUIFont.KeyboardAction+standardButtonFontWeightnow returns aFont.Weightinstead of aUIFont.Weight.KeyboardActionstandardButtonImage- the property is deprecated in favor for the context-based function.- The old properties are now called
standardButtonUIFontandstandardButtonUIFontWeight.
This version adds new locales as well as features that make it easier to work with layouts and collections.
In this version, you can also identify the active app ID, which makes it possible to adjust the keyboard accordingly.
There are also several tweaks and behavior changes that make system keyboards behave even more native-like.
- 🇬🇧 English U.K. (GB)
- 🇺🇸 English U.S. (same keyboard as base English but different region)
-
CGFloathas a newstandardKeyboardButtonCornerRadiusproperty. -
DeleteBackwardRangeis a new enum can be used when deleting backwards. -
EnglishKeyboardInputSetProviderhas new currency init params. -
KeyboardAction.PrimaryTypehas newnewLinecase, that can be used to force an arrow for primary buttons. -
KeyboardBehaviorhas a newbackspaceRangeproperty. -
KeyboardColoris a new enum that exposes the raw color resources. -
KeyboardContexthas a newactiveAppBundleIdproperty that identifies the currently active app. -
KeyboardContexthas a newscreenOrientationproperty that replacesdeviceOrientation. -
KeyboardPreviewModeis a new (hopefully temporary) class that has a staticenable()function that makes SwiftUI previews work. -
KeyboardInputViewControllerhas a newactiveAppBundleIdproperty that identifies the currently active app. -
RepeatGestureTimerhas been made public and can be used to inspect how long a repeat gesture has been active. -
RowItemis a new protocol that makes it possible to gather row collection functions in one place -Collection+RowItem. -
Collection+RowItemhas new extensions that make it easier to add and remove row items to all collections that contain the newRowItemprotocol. -
EdgeInsets+Keyboardhas new context-based extensions. -
UIInputViewController+OrientationrenamesdeviceOrientationtoscreenOrientation. -
UITextDocumentProxy+Deletehas a new extension for deleting backwards a certain range.
-
KeyboardActionnow implementsRowItem. -
iPadKeyboardLayoutProviderhas been adjusted layout buttons closer to native layouts. -
iPhoneKeyboardLayoutProviderhas been adjusted layout buttons closer to native layouts. -
KeyboardInputnow implementsRowItem. -
KeyboardLayoutItemnow implementsRowItem. -
StandardKeyboardBehaviornow only auto-switches keyboard type on.tap. -
UITextDocumentProxyhandles new lines when checking if the cursor is at new sentence. -
Standard font sizes are adjusted to fit the native keyboards better.
-
The standard backspace range is now progressive and will increase after backspace has been pressed for a while.
KeyboardContextdeviceOrientationhas been renamed toscreenOrientation.UIApplicationpreferredKeyboardInterfaceOrientationdidn't work and will be removed.UIDeviceOrientationinterfaceOrientationis no longer used and will be removed.UIInputViewControllerdeviceOrientationhas been renamed toscreenOrientation.UIInterfaceOrientation- the device orientation-based init is no longer used and will be removed.
KeyboardBehaviorhas a newbackspaceRangeproperty that must be implemented.
Besides the points above, KeyboardActionHandler had a convenience handle function that didn't require a sender. This caused a conflict with the StandardKeyboardActionHandler function with the same signature. Subclassing StandardKeyboardActionHandler and calling super.handle thus caused a never-ending loop, since the convenience function called the sender function etc.
The sender-based functions have thus been removed. If you have a custom action handler that overrides handle or canHandle, you must remove the sender parameter.
This version tweaks KeyboardGestures to avoid delays.
This version introduces a bunch of changes to how feedback is being handled.
AudioFeedbackConfigurationhas default init param values.DragGestureHandleris a new protocol for handling drag gestures.HapticFeedbackPlayeris a new protocol for preparing and playing haptic feedback.KeyboardActionhas a newstandardAction(for:gesture)function.KeyboardFeedbackHandleris a new protocol for handling keyboard feedback.KeyboardFeedbackSettingsis a new, observable settings object.KeyboardGestureis nowCaseIterable.KeyboardInputViewControllerhas a newsetup(with:)that takes aUIStackView.KeyboardInputViewControllerhas a newkeyboardFeedbackHandlerproperty.KeyboardInputViewControllerhas a newkeyboardFeedbackSettingsproperty.StandardHapticFeedbackPlayeris a standard implementation that is used by default.StandardKeyboardActionHandlerhas new, cleaner initializers.StandardKeyboardActionHandlerhas a newtriggerFeedbackfunction.StandardKeyboardActionHandlerhas a newspaceDragGestureHandlerthat is used to handle space drag gestures.StandardKeyboardFeedbackHandleris a new, standard feedback handler.- There are new mocks for the new classes.
- More feedback types are now
Equatable. - Action feedback (e.g. tap sound) is now given on
pressinstead oftap. StandardKeyboardActionHandleruses the new feedback handler to trigger feedback.
- Audio feedback types have been moved to
Feedback. - Haptic feedback types have been moved to
Feedback.
AudioFeedbacksystemPlayerhas been renamed toplayer.KeyboardInputViewControllerkeyboardStackViewhas been replaced with a newsetup(with:).StandardKeyboardActionHandlerhas deprecated the two audio/haptic configuration-based initializers.StandardKeyboardActionHandleraudioConfigurationis deprecated and converted to a computed property.StandardKeyboardActionHandlerhapticConfigurationis deprecated and converted to a computed property.StandardKeyboardActionHandlerspaceDragSensitivityis deprecated.StandardKeyboardActionHandlerhandleSpaceCursorDragGestureis deprecated.StandardKeyboardActionHandlertriggerAudioFeedbackis deprecated.StandardKeyboardActionHandlertriggerHapticFeedbackis deprecated.StandardKeyboardActionHandlertriggerHapticFeedbackForLongPressOnSpaceDragGestureis deprecated.
This version adds support for primary actions, such as .done, .go, .search etc.
BaseKeyboardLayoutProviderhas a new, openkeyboardReturnAction(for:)function.KeyboardActionhas a newstandardTextDocumentProxyAction.KeyboardActionhas a newstandardTextDocumentProxyInputAction.KeyboardAction.primaryis a new action type that gathers all primary action types.KKL10nhas newtext(for:)functions that let you translate keys for specific contexts and locales.String+sentenceDelimitersandwordDelimiterscan now be modified, if you have specific needs.- The iPhone and iPad layout providers now replaces
returnwithdone,goandsearchwhen applicable.
- English (US) secondary actions now include actions for
$.
- New line is now considered to be a
worddelimiter instead of asentencedelimiter. - Due to the new ways to localize content, some signatures must be changed to optional strings.
KeyboardAction.done,.go,.okand.searchhave been deprecated and replaced with the newprimaryumbrella type.
This version is all about locales and autocomplete, overall:
This version adds support for danish, finnish, norwegian and dutch.
This version also adds many new features aimed at an improved autocomplete experience.
KeyboardKit Pro 4.1 also adds more locale-specific providers as well as a real autocomplete engine.
- 🇩🇰 Danish
- 🇳🇱 Dutch
- 🇫🇮 Finnish
- 🇳🇴 Norwegian
AutocompleteSpaceStateis a new enum that is used to keep track of how aAutocompleteSuggestionhas newisAutocompleteandisUnknownproperties.AutocompleteSuggestionProviderhas new functions for ignoring and learning words.AutocompleteToolbarhas a newitemBuilderinitializer.AutocompleteToolbarItemis a new view that replicates a native autocomplete item.AutocompleteToolbarItemTextis a new view that replicates the text of a native autocomplete item.KeyboardActionhas a newisSpaceproperty.KeyboardActionhas a newshouldApplyAutocompleteSuggestionproperty.KeyboardActionhas a newshouldReinsertAutocompleteInsertedSpaceproperty.KeyboardActionhas a newshouldRemoveAutocompleteInsertedSpaceproperty.KeyboardLocalenow implementesIdentifiable.KeyboardLocalehas newflag,idandlocaleIdentifierproperties.KeyboardLocalehas newsortedcollection extensions.KeyboardInputViewControllerhas a newautocompleteSuggestionProviderproperty.KeyboardInputViewControllerhas now implementedperformAutocompleteandresetAutocomplete.StandardKeyboardActionHandlerhas a newtryApplyAutocompleteSuggestionfunction.StandardKeyboardActionHandlerhas a newtryHandleReplacementActionfunction.StandardKeyboardActionHandlerhas a newtryReinsertAutocompleteRemovedSpacefunction.StandardKeyboardActionHandlerhas a newtryRemoveAutocompleteInsertedSpacefunction.SystemKeyboardSpaceButtonContenthas a new initializer that lets you inject a custom space view.UITextDocumentProxyhas a newhasAutocompleteInsertedSpaceproperty.UITextDocumentProxyhas a newhasAutocompleteRemovedSpaceproperty.UITextDocumentProxyhas a newinsertAutocompleteSuggestionfunction.UITextDocumentProxyhas a newisOpenAlternateQuotationBeforeInput(for:)function.UITextDocumentProxyhas a newisOpenQuotationBeforeInput(for:)function.UITextDocumentProxyhas a newpreferredReplacement(for:locale:)function.UITextDocumentProxyhas a newtryInsertSpaceAfterAutocomplete)function.UITextDocumentProxyhas a newtryReinsertAutocompleteRemovedSpacefunction.UITextDocumentProxyhas a newtryRemoveAutocompleteInsertedSpacefunction.
KeyboardInputViewControllernow uses combine observations to keep locale in sync.
AutocompleteSuggestion+replacementhas been renamed totext.AutocompleteToolbar+ButtonBuilderhas been renamed toItemBuilder.KeyboardLocale+keyhas been renamed toid.LocaleKeyhas been renamed toKeyboardLocale.
AutocompleteSuggestion+replacementhas been deprecated due to the name change above.AutocompleteToolbar+buttonBuilderinit has been deprecated and replaced with theitemBuilderone.AutocompleteToolbar+standardReplacementhas been deprecated.LocaleKeyhas been deprecated due to the name change above.KeyboardLocale+keyhas been deprecated.KeyboardInputViewController+changeKeyboardLocalehas been deprecated.KeyboardInputViewController+changeKeyboardTypehas been deprecated.
AutocompleteSuggestionProviderhas new properties and functions that must be implemented. If you have an instance that breaks, just create dummy implementations that does nothing.
This patch fixes a bug with the numeric/symbolic auto-switch back to alphabetic, that could cause a keyboard to get stuck in alpha.
This patch fixes a few minor things.
- 🇮🇹 Italian
- 🇩🇪 German
.donewas accidentally missing a localized text.- English, German and Italian keyboards used an invalid double quote key text.
- Title1 font is now used for input keys with two characters, e.g. Swedish "kr" currency.
- Numeric and symbolic keyboards didn't auto-switch to alphabetic when tapping space.
This patch fixes a few minor things:
LocaleKeynow implementsCaseIterable.
StandardKeyboardActionHandlerhad a memory leak that has been fixed.
SwiftUI: Rising. In the shadows no more!
It's time for SwiftUI to rise and become the unrelenting force we always knew it would become.
KeyboardKitSwiftUI has been merged into this repository and the deployment target is raised to iOS 13.
SwiftUI support is a first-class citizen from now on. UIKit support is still around, but will no longer be actively developed. The future is a bright, declarative one!
Although these release notes aim at covering everything that has changes in this major version, some things will most probably be missed.
Besides the new things listed below, there are a bunch of new extensions, images etc.
Calloutshas new types and providers for working with callouts.Image.emojino longer requires iOS 14, but usesperson.crop.circleas fallback on iOS 13.Inputhas new types and providers for working with keyboard layouts.KeyboardActionhas new actions -go,nextLocale,okandreturn.KeyboardActionhas new, localized standard button texts for some actions.KeyboardActionhas newisPrimaryActionproperty.KeyboardActionhas newstandardButtonFontWeightproperty.KeyboardAppearancehas a newimage(for:).KeyboardCasinghas a newneutralcase that can be used to show the original state of the inputs.KeyboardContexthas a newlocaleslist and a newselectNextLocalefunction.KeyboardGesturehas newpressandreleasegestures.KeyboardInputis a new input type that simplifies building unicode-based keyboards.KeyboardInputSetis now based onKeyboardInputs instead of strings.KeyboardInputViewControllerhas a new staticsharedinstance.KeyboardInputViewControllerhas a newkeyboardActionHandler.KeyboardInputViewControllerhas a newkeyboardAppearance.KeyboardInputViewControllerhas a newkeyboardBehavior.KeyboardInputViewControllerhas a newkeyboardContext.KeyboardInputViewControllerhas a newkeyboardInputCalloutContext.KeyboardInputViewControllerhas a newkeyboardInputSetProvider.KeyboardInputViewControllerhas a newkeyboardLayoutProvider.KeyboardInputViewControllerhas a newkeyboardSecondaryInputActionProvider.KeyboardInputViewControllerhas a newkeyboardSecondaryInputCalloutContext.KeyboardInputViewControllersetup(with:)is now open and overridable.KeyboardEnabledStateis a new observable class that keeps in sync with the keyboard enabled state.KeyboardLayoutProviderhas a newregister(inputSetProvider:)to simplify changing global input set provider.Layouthas new types and providers for working with keyboard layouts.Localeis a new namespace with a few new locale-specific utils.LocaleDictionaryis a simple dictionary wrapper to work with localized resources.LocaleKeyis a simple enum to gather top-level locale identifiers.KKL10nis a new enum that provides localized strings from KeyboardKit.SystemKeyboardnow highlights buttons when typing on iPad.Viewhas newkeyboardInputViewControllerconvenience extensions.View+keyboardToasthas new context-based function.View+localeContextMenucan be applied to any view to let the user change locale.- There are new preview-specific implementations that can help you preview keyboard-based views.
AutocompleteContextis now an observable object and not a protocol.AutocompleteToolbaris now generic, which makes your .AutocompleteToolbarnow uses identifiable bar items, which leads to better separator handling.AutocompleteToolbarnow takes suggestions at init and doesn't require an environment injectedAutocompleteContext.AutocompleteToolbarno longer requires an environment injectedObservableKeyboardContext, nor does its builder functions.EmojiCategorynow uses theEmojitype instead of a char.FrequentEmojiProvidernow uses theEmojitype instead of a char.KeyboardActionstandardButtonFonthas been coverted to a function.KeyboardActionstandardButtonTexthas been coverted to a function.KeyboardActionstandardButtonTextStylehas been coverted to a function.KeyboardAction.emojinow uses theEmojitype instead of a char.KeyboardAction.emojiCategoryno longer has a standard tap action.KeyboardActionRowstandardButtonImageno longer takes a context.KeyboardBehaviorno longer takes a context as function input.KeyboardContextis now an observable object and not a protocol.KeyboardContextno longer has any services, just inspectable properties.KeyboardGesturesnow handles the new press and release gestures.KeyboardInputSetProviderimplementations now provides punctuation as well.KeyboardInputSetProviderno longer takes a context as function input.KeyboardInputViewControllercontextis now anObservableKeyboardContext.KeyboardInputViewControllercontextis now calledkeyboardContext.SecondaryCalloutActionProviderno longer takes a context as function input.SecondaryInputCalloutContextno longer requires a context init parameter.StandardKeyboardActionHandlerno longer depends on an input view controller.StandardKeyboardActionHandlernow requires an injected keyboard context and behavior.StandardKeyboardActionHandlernow requires an injected autocomplete and keyboard change action.StandardKeyboardActionHandlernow handles the new press and release gestures.StandardKeyboardActionHandlertriggerAutocompleteis replaced by an injectable function.StandardKeyboardAppearancewill useisPrimaryActionto apply a blue color to those actions.StandardKeyboardAppearancewill fallback to the action's standard font weight instead ofnil.StandardKeyboardBehaviornow requires an injected keyboard context.StandardKeyboardInputSetProvidernow requires an injected keyboard context.View+KeyboardGesturesnow handles the new press and release gestures.
- All unused extensions have been removed.
- All previous deprecations have been removed.
- All internal-only used extensions have been made internal.
InputCalloutContext.sharedhas been removed. Use the environment object instead.KeyboardAction+SecondaryCalloutActionshas been replaced with newCallouts/Providersproviders.KeyboardActionRowhas been removed, since it's confusing to have two aliases for the same thing.KeyboardAppearancebutton properties are prefixed withbutton.KeyboardAppearancefontandfontWeighthave been merged into a singlefontproperty.KeyboardAppearanceProviderhas been renamed toKeyboardAppearance.KeyboardButtonWidthhas been renamed toKeyboardLayoutWidth.KeyboardContextactionHandlerhas been moved to the input vc.KeyboardContextkeyboardAppearanceProviderhas been moved to the input vc.KeyboardContextkeyboardBehaviorhas been moved to the input vc.KeyboardContextkeyboardInputSetProviderhas been moved to the input vc.KeyboardContextkeyboardLayoutProviderhas been moved to the input vc.KeyboardDimensionsis no longer used and has been removed.KeyboardInputSetlocale extensions have been removed.KeyboardInputSetstandard input set extensions have been removed.KeyboardInputViewControlleraddKeyboardGestureshas been converted toKeyboardButton+Gestures.KeyboardInputViewControllercontexthas been renamed tokeyboardContext.KeyboardInputViewControllerkeyboardTypehas been removed - use the context directly!KeyboardInputViewControllersetupKeyboardhas been removed and moved to the UIKit demo.KeyboardInputViewController+Gestureshas been converted toKeyboardButton+Gestures.KeyboardLayoutactionRowshas been renamed toitemsand are of a newKeyboardLayoutItemRowstype.KeyboardCasinghas been renamed toKeyboardCasingKeyboardStateInspectorhas been renamed toKeyboardEnabledStateInspector.ObservableAutocompleteContexthas been renamed toAutocompleteContext.ObservableKeyboardContexthas been renamed toKeyboardContext.PhotosImageServiceandStandardPhotosImageServicehave been removed.Settingshas been entirely removed.SecondaryInputCalloutContext.sharedhas been removed. Use the environment object instead.StandardKeyboardContexthas been replaced byObservableKeyboardContext.StandardKeyboardActionHandlerhas a new vc-based initializer.StandardKeyboardActionHandlerno longer takes an optional sender for keyboard actions.StandardKeyboardActionHandlergesture actions has been gathered in a singleaction(for:on).StandardKeyboardAppearanceProviderhas been renamed toStandardKeyboardAppearance.StandardKeyboardLayoutProviderno longer has left and right space actions. Implement this in a custom provider instead.SystemKeyboardDimensionsis no longer used and has been removed.UIImage+pasteboardhas been moved to the demo.UIImage+photoshas been moved to the demo.UIImage+resizedhas been removed.UIImage+tintedhas been removed.UIInputViewController+NextKeyboardhas been made an internal extension inUIView+Keyboard.View+Button"standard button" functions have been replaced by a singlekeyboardButtonStylefunction.View+ClearInteractablehas been removed.ViewkeyboardAction(...)has been renamed tokeyboardGestures(for: ...).UIEdgeInsets+KeyboardstandardKeyboardButtonInsetshas been renamed tostandardKeyboardButtonInsets.
In this version, UIKit is replaced by SwiftUI as the primary layout engine.
As such, to avoid UIKit parts blocking SwiftUI, types in the UIKit folder will be renamed to start with UI:
AutocompleteToolbarLabel->UIAutocompleteToolbarLabelAutocompleteToolbarSeparator->UIAutocompleteToolbarSeparatorAutocompleteToolbarView->UIAutocompleteToolbar(OBS! Name change as well.)HorizontalKeyboardComponent->UIHorizontalKeyboardComponentKeyboardAlert->UIKeyboardAlertKeyboardButton->UIKeyboardButtonKeyboardButtonCollectionView->UIKeyboardButtonCollectionViewKeyboardButtonRowCollectionView->UIKeyboardButtonRowCollectionViewKeyboardButtonView->UIKeyboardButtonViewKeyboardButtonRowComponent->UIKeyboardButtonRowComponentKeyboardCollectionView->UIKeyboardCollectionViewKeyboardToolbarComponent->UIKeyboardToolbarComponentKeyboardToolbarView->UIKeyboardToolbarViewKeyboardSpacerView->UIKeyboardSpacerViewKeyboardStackViewComponent->UIKeyboardStackViewComponentPagedKeyboardComponent->UIPagedKeyboardComponentRepeatingGestureRecognizer->UIRepeatingGestureRecognizerShadow->UIShadowToastAlert->UIKeyboardToastAlert(OBS! Name change as well.)VerticalKeyboardComponent->UIVerticalKeyboardComponent
Their functionality remains intact, however.
There are a new extension as well, as UIKit support moves away from the core layer:
UIView+Keyboardis now used to apply button gestures to a view, instead of having this functionality in the view controller.
This release adds fake protocol implementations, to simplify creating SwiftUI previews.
The release also adds some things for the future:
KeyboardButtonWidthis a new way to express the width of a keyboard button.View+KeyboardButtonWidthis a new way to apply a width to a keyboard button.
Although not used by the standard keyboards yet, I still wanted to add them before starting working on 4.0.
This release rolls back some changes to try improve dark appearance keyboards in SwiftUI.
Seems like dark appearance can't be detected, since this also enables dark mode. Hopefully this is easier to fix in KK 4.0.
This release adds a time threshold to the end sentence action.
This release also fixes so that CalloutCurve and CustomRoundedRect handles invalid rects.
This release fixes so that the secondary input gesture triggers a tap if there were no secondary actions in the callout.
-
Emojiis a new struct that in the future will let us work more with emojis in a more structured and type-safe way. -
EmojiCategorynow lets you register afrequentEmojiProvider, and uses that to populate the frequent category. -
There is a new
EmojiProviderprotocol -
There is a new
FrequentEmojiProviderprotocol -
There is a new
MostRecentEmojiProviderclass -
There is a new
String+Delimitersextension with word and sentence delimiters. -
There are new
UITextDocumentProxu+Contentextensions to get previous sentences and words. -
AutocompleteToolbarhas a new, staticstandardReplacementfunction. -
AutocompleteToolbarhas a new, staticstandardReplacementActionfunction. -
AutocompleteToolbarnow lets you provide an optional, customreplacementActionin init. -
Color+Resourcesis a new extension that provides asset-based colors that adapt to dark mode. -
EmojiCategoryKeyboardis a new view that lists the emojis of a selected category and a menu. -
EmojiCategoryKeyboardMenuis a new view that lets the user select one of multiple categories. -
EmojiKeyboardis a new view that renders a set of emojis in a lazy grid. The item action is customizable.
-
EmojiCategorynow implementsEmojiProvider -
EmojiCategory.frequentnow returns emojis from thefrequentEmojiProvider. -
StandardKeyboardActionHandlernow tries to register emojis with theEmojiCategoryfrequent emoji provider. -
Color+Buttonuses the new asset-based colors. -
SystemKeyboardButtonBodynow 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.
- The
´accent was accidentally used in standard numeric keyboards. It has now been replaced with’, which is the correct one.
-
KeyboardContext.emojiCategoryhas been deprecated. This should be persisted by the view instead. -
PhotosImageServiceand the standard implementation has been deprecated. Copy it to your own project if you want to keep on using it. -
UIImage+Photoshas been deprecated. Copy it to your own project if you want to keep on using it. -
Some button-specific
Colorextensions have been deprecated. -
View+keyboardAction(:context:)has been deprecated.
secondaryCalloutInputProviderhas been removed fromKeyboardContext. It's now only in the secondary context.
This release fixes so that the secondary input gesture triggers a tap if there were no secondary actions in the callout.
The release also makes the entire autocomplete button tappable, instead of just the text.
This release fixes so that upper-cased chars gets secondary callout actions and that the input callout isn't dismissed if there are no secondary actions.
This release makes it easier to inject custom views into the SwiftUI-based SystemKeyboard and AutocompleteToolbar.
There is also a new SystemKeyboardSpaceButton which lets you present the current locale before fading to "space".
The release also adds a spacebar drag gesture and deprecates some haptic properties as well as some system properties in favor of the standard naming concept (since the system behavior is the standard behavior).
-
AutocompleteSuggestionis a new protocol that makes the autocomplete provider concept more general. -
HapticFeedbackhas a newlongPressOnSpacecase. -
KeyboardAppearanceProvideris a protocol for providing button content and style. -
KeyboardContexthas a newkeyboardAppearanceProviderproperty. -
StandardKeyboardActionHandlerhas new functionality for handling the space drag gesture. -
StandardKeyboardAppearanceProvideris a standard appearance provider that returns standard values. -
SystemKeyboardButtonContentis new view that extracts content logic fromSystemKeyboardButton. -
SystemKeyboardButtonRowItemcan now be created with generic views. -
SystemKeyboardSpaceButtonis new view that wrapsSystemKeyboardSpaceButtonContentand applied a style and gestures to it. -
SystemKeyboardSpaceButtonContentis new view that animates between a locale text and a space text.
HapticFeedback.standardhas almost no haptic feedback now, since that is the standard behavior.SystemKeyboardnow wraps thebuttonBuildergenerated views in aSystemKeyboardButtonRowItem.SystemKeyboardButtonnow applies a fallback text from the new appearance provider.- The standard
SystemKeyboardbutton builder generatesSystemKeyboardButtonContentinstead ofSystemKeyboardButton.
-
HapticFeedbackstandard cases have been deprecated, since native keyboards have almost no haptic feedback. -
KeyboardActionsystemFontis renamed tostandardButtonFont. -
KeyboardActionsystemKeyboardButtonTextis renamed tostandardButtonText. -
KeyboardActionsystemTextStyleis renamed tostandardButtonTextStyle. -
KeyboardTypesystemKeyboardButtonTextis deprecated. -
StringimplementsAutocompleteSuggestionto avoid breaking changes in KK 3.5+. You should provide your own custom types, though. -
ColorsystemKeyboardButtonBackgroundColorDarkhas been renamed tostandardDarkButtonBackgroundColor -
ColorsystemKeyboardButtonBackgroundColorLighthas been renamed tostandardLightButtonBackgroundColor -
ColorsystemKeyboardButtonForegroundColorhas been renamed tostandardButtonForegroundColor -
ColorsystemKeyboardButtonShadowColorhas been renamed tostandardButtonShadowColor -
KeyboardActionsystemKeyboardButtonBackgroundColorhas been renamed tostandardButtonBackgroundColor -
KeyboardActionsystemKeyboardButtonImagehas been renamed tostandardButtonImage -
KeyboardActionsystemKeyboardButtonShadowColorhas been renamed tostandardButtonShadowColor -
KeyboardCasingsystemImagehas been renamed tostandardButtonImage -
KeyboardCasingsystemKeyboardButtonImagewas unused and has been deprecated. -
KeyboardTypesystemKeyboardButtonImagehas been renamed tostandardButtonImage -
ViewsystemKeyboardButtonStylehas been renamed tostandardButtonStyle -
ViewsystemKeyboardButtonBackgroundhas been renamed tostandardButtonBackground -
ViewsystemKeyboardButtonFonthas been renamed tostandardButtonFont -
ViewsystemKeyboardButtonForegroundhas been renamed tostandardButtonForeground -
ViewsystemKeyboardButtonShadowhas been renamed tostandardButtonShadow
AutocompleteToolbarViewandAutocompleteToolbarnow useAutocompleteSuggestioninstead ofString. It makes them MUCH more powerful, so I hope this breaking change is acceptable.SystemKeyboardButtonRowItemhas been made generic.SystemKeyboard.ButtonBuildernow returns anAnyViewsince you may want to use any custom view for any button.
This release adds curves and behavior changes to the callout bubbles.
- The disabled secondary % callout actions have been re-enabled.
CalloutStylenow applies button frame insets when configured for a system keyboard.InputCallouthas curves between the button area and the callout.InputCalloutContexthas a newisEnabledproperty that is only true for phones, since it should not be displayed on iPads.InputCalloutContextno longer insets the button rect.SecondaryInputCallouthas curves between the button area and the callout and the design is improved.SystemInputCalloutContextno longer insets the button rect.
CalloutCurveis a new shape that can be used to smoothen the two parts of a callout bubble.
This release fixes some visual artefacts in the callout bubbles.
From now on, release notes will include changes in both KeyboardKit and KeyboardKitSwiftUI.
This release adds support for input callouts and secondary input callouts.
This release has new features for secondary callout actions.
-
KeyboardAction+SecondaryCalloutActionsspecifies standard, locale-specific secondary callout actions for keyboard actions. -
KeyboardContexthas a newsecondaryCalloutActionProviderproperty. -
SecondaryCalloutActionProvideris a protocol for providing secondary callout actions for keyboard actions. -
StandardSecondaryCalloutActionProvideris a standard action provider that returns the standard secondary callout actions. -
CalloutStyleis a shared style for keyboard button callout. -
InputCalloutis a callout that can highlight the currently pressed keyboard button. -
InputCalloutContextcan be used to controlInputCalloutviews. -
InputCalloutStylecan be used to styleInputCalloutviews. -
SecondaryInputCalloutis a callout that can present secondary actions for the currently pressed keyboard button. -
SecondaryInputCalloutContextcan be used to controlSecondaryInputCalloutviews. -
SecondaryInputCalloutStylecan be used to styleSecondaryInputCalloutviews. -
View+InputCalloutcan be used to wrap any view in aZStackwith a topmostInputCallout -
View+SecondaryInputCalloutcan be used to wrap any view in aZStackwith a topmostSecondaryInputCallout
Since the new secondary input callout, which triggers on long press, I have removed the standard long press action for all actions except backspace.
This also makes standard KeyboardKit keyboards behave more like native iOS keyboards.
View+KeyboardGestureshas been extended with gestures forInputCalloutandSecondaryInputCallout.
This release also has breaking changes to experimental features.
KeyboardInputProviderhas been renamed toKeyboardInputSetProviderKeyboardInputSetProviders properties are now context-based functionsKeyboardContextkeyboardInputProviderhas been renamed tokeyboardInputSetProviderObservableKeyboardContextkeyboardInputProviderhas been renamed tokeyboardInputSetProvider
This release contains a bunch of new features that makes the keyboard behave more like the native keyboards when typing, for instance auto-capitalization and auto-lowercasing.
This release separates action handling from behavior, which I hope makes the code cleaner and easier to test and simplifies reusing behavior outside of an action handling context.
KeyboardBehaviorspecifies how a keyboard should behave.StandardKeyboardBehaviorspecifies the standard behavior of a western keyboard.
You can create your own behaviors as well as subclass and override parts of the standard behavior.
Note that this is an experimental feature that may have to be revisited before 4.0.
KeyboardContexthas a newpreferredKeyboardTypeproperty.KeyboardContexthas a newactionBehaviorproperty.StandardKeyboardBehaviorhas caps-lock double tap logic.UITextDocumentProxyhas a newisCursorAtNewSentenceproperty.UITextDocumentProxyhas a newisCursorAtNewWordproperty.UITextDocumentProxyhas a newendSentencefunction that removes any space before the cursor, then closes the sentence.UITextDocumentProxyhas a newsentenceDelimitersproperty.UITextDocumentProxyhas a newwordDelimitersproperty.
- The caps-lock double tap logic is moved from double-tap on shift to the new keyboard behavior.
- The sentence ending logic is moved from double-tap on space to the new keyboard behavior.
- The sentence ending logic is no longer based on double-tap, which makes it easier to use.
KeyboardActionstandardDoubleTapActionis not defined for any actions anymore.KeyboardInputViewControllerchangeKeyboardTypehas no time interval anymore.StandardKeyboardContextinitializer now has a default value for the keyboard type.
- The standard keyboard layout has been fixed to use the correct caps-lock button image.
KeyboardActionendSentenceActionhas been moved toUITextDocumentProxy+EndSentence.KeyboardActionstandardDoubleTapActionis not used internally anymore.KeyboardContextchangeKeyboardTypeis not used internally anymore.KeyboardTypecanBeReplacedis not used internally anymore.StandardKeyboardActionHandlerhandleKeyboardSwitchis renamed tohandleKeyboardTypeChange.StandardKeyboardActionHandlerpreferredKeyboardTypehas been moved to the keyboard behavior.
These deprecations will be removed in v 4.0.
This release contains improvements to the input set logic:
- There is a new
KeyboardInputProviderprotocol. StandardKeyboardInputProvidertries to use the current locale (fallback to English) and can be inherited.StaticKeyboardInputProvideruses three static input sets.InputSet+Englishhas been renamed toInputSet+Localeand has more sets.InputSet+Localeextension has support for basic English, German, Italian and Swedish.StandardKeyboardInputProvideris used by default in the context, but you can change this at anytime.
The release also introduces a new "keyboard layout" concept, where a keyboard layout is an input set with surrounding actions:
- There is a new
KeyboardLayoutstruct. - There is a new
KeyboardLayoutProviderprotocol.StandardKeyboardLayoutProvideruses the current context and can be inherited.StaticKeyboardLayoutProvideruses a static layout that is provided at init.
StandardKeyboardLayoutProvideris used by default in the context, but you can change this at anytime.
There are new properties in the KeyboardContext.
This release also makes it easier to resolve system keyboard dimensions:
CGFloat+Keyboardhas utils to resolve the standard keyboard row height.KeyboardStackViewComponents use this new standard height as default height.UIEdgeInsets+Keyboardhas utils to resolve the standard keyboard row item insets.KeyboardButtonRowComponents use these new standard insets as default insets.
The demos have been updated with these changes.
- The context controller propertis are marked as
@unownedto fix a memory leak.
CGFloat+KeyboardDimensionsis deprecated and will be removed in 4.0.KeyboardContext'scontrolleris now deprecated and will be removed in 4.0 .Usage is strongly discouraged. Use the context instead.
KeyboardContexthas new properties to make the new input and layout additions possible. If you have created your own context, you will have to add these.
This version contains new features:
EmojiCategoryis nowCodable.EmojiCategoryhas afallbackDisplayEmojithat is used as system button text if no custom button image used.KeyboardActionnow has a standard tap action for.emojiCategory.KeyboardContextnow has anemojiCategoryproperty.
This version contains new protocols and classes:
KeyboardInputViewControllerhas new, emptyperformAutocompleteandresetAutocompletefunctions that are called by the system at proper times.- The new
AutocompleteSuggestionstypealias makes the autocomplete apis cleaner. - There is a new
AutocompleteContextprotocol that can be used to manage suggestions. - There is a new
StandardAutocompleteContextimplementation ofAutocompleteContext. - There is a new
UITextDocumentProxyproperty to check if the proxy cursor is at the end of the current word.
- The "end sentence" action that is used by space double taps, uses the new proxy property to only close when the cursor is at the end of a word.
In this version:
- A memory leak was fixed by making all
StandardBookActionHandleractions use[weak self]. - The UIKit button shadow logic was improved by @jackhumbert.
This version fixes a bug, where the globe button that is used by the demo keyboards didn't do anything.
This version also fixes the system image's font weight.
This version removes all previously deprecated parts of the library and adds improved support for SwiftUI and iOS 13.
If you upgrade from an older version to 3.0 and have many breaking changes, upgrading to 2.9 first provides deprecation help that may make the transition easier.
There is a new KeyboardContext, which provides important contextual information.
StandardKeyboardContextis the standard, non-observable implementation.ObservableKeyboardContextis an iOS 13+ required, observable implementation.StandardKeyboardActionHandlernow automatically handles keyboard type switching and only delays if an action has a double-tap action.StandardKeyboardActionHandlernow automatically switches to certain keyboards after certain actions, as defined byhandleKeyboardSwitch(after:on:)andpreferredKeyboardType(after:on:).
There are new KeyboardAction types and properties:
.controlrepresents the system..systemImagecan be used with SF Symbols..systemFontand.systemTextStyleprovide system look information.
There is a new System namespace with utils to help you build native-imitating system keyboards.
There is a new KeyboardInputSet concept that will simplify building language-specific keyboards. For now, it contains English characters, numerics and symbols.
The demo project contains a new KeyboardKitSwiftUIPreviews in which you can preview KeyboardKitSwiftUI views.
- This repository has a new SwiftUI-based demo app, which is still in development.
KeyboardImageButtonsupports the newsystemImageaction.
KeyboardInputViewControllerdeviceOrientationhas been converted to a generalUIInputViewControllerextension.setupNextKeyboardButtonhas been converted to a generalUIInputViewControllerextension.
-
KeyboardInputViewControllerhas a newkeyboardContextproperty. -
StandardKeyboardContextis used by default, whenever a keyboard extension is created. -
ObservableKeyboardContextis used by whenever a keyboard switches over to use SwiftUI. -
KeyboardInputViewControllerkeyboardActionHandlerhas been moved toKeyboardContext. -
KeyboardInputViewControllercanChangeKeyboardTypehas been moved toKeyboardType. -
KeyboardInputViewControllerchangeKeyboardTypehas been moved toKeyboardContext. -
KeyboardInputViewControllerchangeKeyboardTypeDelayis now an argument inchangeKeyboardType. -
KeyboardInputViewControllerkeyboardTypehas been moved to the context. -
AutocompleteToolbarhas been renamed toAutocompleteToolbarView. -
EmojiCategory.frequentshas been renamed tofrequent. -
KeyboardActionHandlernow requirescanHandle(_:on:)to be implemented. -
KeyboardActionhas new action types. -
KeyboardActionhas fewerisXXXproperties. -
KeyboardAction.capsLockandshiftDownare now part ofKeyboardAction.shift. -
KeyboardActionRow.fromhas been changed to an initializer. -
KeyboardActionRows.fromhas been changed to an initializer. -
KeyboardImageActionshas been converted to aKeyboardActionRow+Imagesextension initializer. -
KeyboardToolbarhas been renamed toKeyboardToolbarView. -
The
shouldChangeToAlphabeticLowercasehas been replaced with the automatic switching mentioned above. -
The
isKeyboardEnabledfunction now uses aforas external argument name.
AutocompleteBugFixTimerAutocompleteSuggestionProviderprovideAutocompleteSuggestionsKeyboardActionswitchKeyboardKeyboardActionswitchToKeyboardKeyboardActionstandardInputViewControllerActionKeyboardActionstandardTextDocumentProxyActionKeyboardActionHandlerhandleTap/Repeat/LongPressKeyboardActionHandlerhandlegesture onUIViewKeyboardInputViewControlleraddSwitchKeyboardGesturePersistedKeyboardSettinginit with keyStandardKeyboardActionHandlerinitwith feedback instancesStandardKeyboardActionHandleractionfor viewStandardKeyboardActionHandleranimationButtonTapStandardKeyboardActionHandlergiveHapticFeedbackForLongPress/Repeat/TapStandardKeyboardActionHandlerlongPress/repeat/tapActionfor viewStandardKeyboardActionHandlerhandleLongPress/Repeat/TapStandardKeyboardActionHandlertriggerAudio/HapticFeedbackUIColorclearTappableUIInputViewControllercreateAutocompleteBugFixTimerUIViewadd/removeLongPress/Repeating/TapActionisKeyboardEnabledglobal function
This version updates external test dependencies to their latest versions.
This version removes the subview fiddling from KeyboardCollectionVew to the built-in subclasses, since it can ruin the view hierarchy for collection views that don't add custom views to the cells.
This version adds an .emoji keyboard action, which can be used if you need to separate characters from emojis.
This version also extracts the logic of KeyboardAction standardTapAction into:
standardTapActionForControllerstandardTapActionForProxy
This makes it possible to use the standard function in other ways, should you need it.
This version also makes actions of KeyboardCollectionView mutable, causing changes to this property to refresh the view.
This is the last minor version before 3.0, which will remove a bunch of deprecated members.
This version adds more features, fixes some bugs and deprecates many parts of the library.
A big change, which is not fully covered in these notes, is that KeyboardInputViewController and StandardKeyboardActionHandler now handles changing keyboard types. Even if you have to fill a "type" with meaning in your app, you now have implemented logic to help you handle this.
Thanks to @eduardoxlau, the demo also has an improved emoji keyboard.
KeyboardActionhas newstandardTap/DoubleTap/LongPress/Repeataction properties.KeyboardInputViewControllerhas a newdeviceOrientationproperty.KeyboardInputViewControllerhas a newkeyboardTypeproperty.KeyboardInputViewControllerhas newcan/changeKeyboardTypefunctions and properties.KeyboardInputViewControllerhas a newsetupKeyboardfunction.StandardKeyboardActionHandlerhas more logic for handling keyboard type changes.- The new
EmojiCategoryenum represents the native iOS emoji keyboard categories. - The new
KeyboardStateInspectorcan be implemented to get info about the keyboard.
- The demo now switches to caps lock when shift is double-tapped.
- The standard tap animation does not scale up as much as before.
- The standard haptic feedback for tap is light impact instead of medium.
KeyboardAction.switchKeyboardhas been renamed tonextKeyboard.KeyboardAction.switchToKeyboardhas been renamed tokeyboardType.KeyboardAction.standardInputViewControllerActionhas been renamed tostandardTapAction.KeyboardAction.standardTextDocumentProxyActionis no longer used by the system`.addSwitchKeyboardGesture(to:)has been renamed toaddNextKeyboardGesture(to:).- The global
isKeyboardEnabledhas been replaced with a newKeyboardStateInspectorprotocol.
- Double tap handling for space no longer inserts an additional space.
KeyboardType.alphabeticnow uses aKeyboardCasingproperty instead of a bool for if it's upper-cased or not.KeyboardAction.switchToKeyboardis now an alias forkeyboardType. You can still use it when defining actions, but if you switch overKeyboardAction, you have to usekeyboardTypeinstead ofswitchToKeyboard.
This version fixes some division by zero bugs.
This version fixes a gesture-related memory leak by no longer using the gesture extensions that caused the problem. Instead, KeyboardInputViewController has a new set of internal gesture extensions that helps with adding gestures to a button.
This version also adds double-tap action handling to KeyboardKit. It's handled like taps, long presses and repeating actions, but it has no default logic. To handle it, create a custom action handler and override handle(_ gesture:,on action:, sender:).
KeyboardKit does not put any rules on the gesture handling. If you return an action for both a single tap and a double tap, both will be triggered.
- A new
.doubleTapkeyboard gesture.
- The
UIViewaddLongPressActionextension is deprecated. - The
UIViewremoveLongPressActionextension is deprecated. - The
UIViewaddRepeatingActionextension is deprecated. - The
UIViewremoveRepeatingActionextension is deprecated. - The
UIViewaddTapActionextension is deprecated. - The
UIViewremoveTapActionextension is deprecated.
This version upgrades the podspec's Swift version.
This version upgrades its Nimble and Mockery dependencies.
These versions adjust the keyboard settings url.
This version adds the very first (and so far limited) support for SwiftUI. Many new features are iOS 13-specific.
This version also deprecates a bunch of action handling logic and adds new functions that doesn't rely on UIView.
-
KeyboardInputViewControllerhas a newsetupNextKeyboardButton(...)which turns anyUIButtoninto a system-handled "next keyboard" button. -
NextKeyboardUIButtonmakes use of this new functionality, and sets itself up with aglobeicon as well. -
PhotoImageServiceandStandardPhotoImageServicecan be used to save images to photos with a completion instead of a target and a selector. -
KeyboardImageActionsmakes it easy to create a bunch of.imageactions from a set of image names. -
KeyboardActionHandlerhas a newopen handle(_ gesture:on:view:)which is already implemented inStandardKeyboardActionHandler. -
The global
isKeyboardEnabledfunction can be used to check if a certain keyboard extension is enabled or not. -
The
keyboardSettingsURLextension is a convenience extension for finding the url to application settings. -
The
evened(for gridSize: Int)[KeyboardAction]extension appends enough.noneactions to evenly fit the grid size. -
The
saveToPhotos(completion:)UIImageextension is a completion-based way of saving images to photos.
There are some new views that can be used in SwiftUI-based apps and keyboard extensions:
-
KeyboardGriddistributes actions evenly within a grid. -
KeyboardGridRowis used for each row in the grid. -
KeyboardHostingControllercan be used to wrap anyViewin a keyboard extension. -
KeyboardImageButtonview lets you show an.imageaction orImagein aButton. -
NextKeyboardButtonsets itself up with aglobeicon and works as a standard "next keyboard" button. -
PersistedKeyboardSettingis a new property wrapper for persisting settings inUserDefaults. -
Color.clearInteractablecan be used instead of.clearto allow gestures to be detected. -
Image.globereturns the icon that is used for "next keyboard". -
KeyboardInputViewControllersetup(with:View)sets up aKeyboardHostingController. -
ViewwithClearInteractableBackground()can be used to make an entire view interactable.
Note that KeyboardKitSwiftUI is a separate framework, which you have to import to get access to these features.
There are some new UIKit features and extensions:
NextKeyboardUIButtonsets itself up with aglobeicon and works as a standard "next keyboard" button.UIImage.globereturns the icon that is used for "next keyboard".
All UIKit-specific functionality is placed in the UIKit folder. UIKit logic that can be used in SwiftUI is outside it.
isInputActionnow includes.space.isSystemActionno longer includes.space.
UIColor.clearTappablehas been renamed toUIColor.clearInteractable.KeyboardActionHandlerhas deprecated the gesture-explicit handle functions.KeyboardActionHandlerhas deprecated the view-explicit handle function in favor of an optionalAnysender variant.StandardKeyboardActionHandlerhas deprecated a bunch ofUIView-explicit functions in favor of an optionalAnysender variant.
This version fixes a bug, where moveCursorForward moved the cursor incorrectly.
This version adds enableScrolling() and disableScrolling() to AutocompleteToolbar. This makes it possible to make the entire toolbar scroll if its content doesn't fit the screen.
This version adds more autocomplete functionality:
AutocompleteToolbarhas a new convenience initializer that makes it even easier to setup autocomplete.AutocompleteToolbarLabelis the default autocomplete item view and can be tapped to send text to the text document proxy.AutocompleteToolbarLabelbehaves like the native iOS autocomplete view and displays centered text until the text must scroll.- Autocomplete no longer requires the bugfix timer. Instead, just let the action handler request autocomplete suggestions when a tap action is triggered.
The StandardKeyboardActionHandler has new functionality:
animationButtonTap()- can be overridden to change the default animation of tapped buttons.
Deprecations:
- The
AutocompleteBugFixTimerand all timer-related logic has been deprecated. - The
AutoCompleteSuggestionProvider'sprovideAutocompleteSuggestions(for:completion:)is deprecated and replaced withautocompleteSuggestions(for:completion:). - The
StandardKeyboardActionHandler'shandleXXX(on:)are now deprecated and replaced withhandle(:on:view:).
This version adds a bunch of features, tweaks some behaviors and deprecates some logic:
New stuff:
- There is a new
KeyboardActionGesturethat will be used to streamline the action handling api:s. - There is a new
AudioFeedbackenum that describes various types of audio feedback. - There is a new
AudioFeedbackConfigurationthat lets you gather all configurations in one place. - There is a new
HapticFeedback.standardFeedback(for:)function that replaces the old specific properties. - There is a new
HapticFeedbackConfigurationthat lets you gather all configurations in one place. - There is a new
StandardKeyboardActionHandlerinit that uses this new configuration. - There is a new
StandardKeyboardActionHandler.triggerAudioFeedback(for:)that can be used to trigger audio feedback. - There is a new
StandardKeyboardActionHandler.triggerHapticFeedback(for:on:)that replaces the old gesture-specific ones. - There is a new
StandardKeyboardActionHandler.gestureAction(for:)function that is used by the implementation. The old ones are still around. - There is a new
KeyboardType.imagescase that is used by the demo.
Changed behavior:
- There is a new
standardButtonShadowShadowproperty that can be used to mimic the native button shadow.
Deprecated stuff:
- The old
StandardKeyboardActionHandler.init(...)is deprecated, use the new one. - The old
StandardKeyboardActionHandler.giveHapticFeedbackForLongPress(...)is deprecated, use the new one. - The old
StandardKeyboardActionHandler.giveHapticFeedbackForRepeat(...)is deprecated, use the new one. - The old
StandardKeyboardActionHandler.giveHapticFeedbackForTap(...)is deprecated, use the new one. - The old
HapticFeedback.standardTapFeedbackandstandardLongPressFeedbackhave been replaced by the new function.
The old handle functions are still declared in the KeyboardActionHandler protocol, but will be removed in the next major version.
This version adds Xcode 11 and iOS 13 support, including support for dark mode and high contrast color variants.
This version adds autocomplete support, which includes an autocomplete suggestion provider protocol, a new toolbar and new extensions.
The new AutocompleteSuggestionProvider protocol describes how to provide your keyboard with autocomplete suggestions. You can implement it in any way you like, e.g. to use a built-in suggestion database or by connecting to an external data source, using network requests. Note that the network option will be a lot slower and also require you to request full access from your users.
The new AutocompleteToolbar is a toolbar that can display any results you receive from your suggestion provider (or any list of strings for that matter). Just trigger the provider anytíme the text changes and route the result to the toolbar. The toolbar can be populated with any kind of views. Have a look at the demo app for an example.
The new UITextDocumentProxy+CurrentWord extension helps you get the word that is (most probably) being typed. You could use this when requesting autocomplete suggestions, if you only want to autocomplete the current word.
Besides these additions, there are a bunch of new extensions, like UITextDocumentProxy deleteBackward(times:), which lets you delete a certain number of characters. Have a look at the Extensions namespace for a complete list.
There is also a new KeyboardCasing enum that you can use to keep track of which state your keyboard has, if any. This enum is extracted from demo app code that was provided by @arampak earlier this year.
IMPORTANT iOS has a bug that causes textWillChange and textDidChange to not be called when the user types, only when the cursor moves. This causes autocomplete problems, since the current word is not changing as the user types. Due to this, the input view controller must use an ugly hack to force the text document proxy to update. Have a look at the demo app to see how this is done.
This version solves some major bugs in the repeating gesture recognizer and makes some public parts of the library open.
The standard action handler now handles repeating actions for backspace. You can customize this in the same way as you customize tap and long press handling.
You can test the new repeating logic in the demo app.
This version adds more keyboard actions that don't exist in iOS, but that may serve a functional or semantical purpose in your apps:
commandcustom(name:)escapefunctionoptiontab
The new custom action is a fallback that you can use if the existing action set is insufficient for your specific app.
I have added a RepeatingGestureRecognizer and an extension that you can use to apply it as well. It has a custom initial delay as well as a custom repeat interval, that will let you tap and hold a button to repeat its action. In the next update, I will apply this to the backspace and arrow buttons.
Thanks to @arampak, the demo app now handles shift state and long press better, to make the overall experience much nicer and close to the native keyboard. The keyboard buttons also registers tap events over the entire button area, not just the button view.
This version makes a bunch of previously internal extensions public. It also adds a lot more unit tests so that almost all parts of the library are tested.
The default tap animation has been configured to allow user interaction, which reduces the frustrating tap lag that was present in 2.0.0.
I have added a KeyboardToolbar class, which you can use to create toolbars. It's super simple so far, and only creates a stack view to which you can any views you like.
This version adds a public shadow extension to the main library and shuffles classes and extensions around. It also restructures the example project to make it less cluttered.
I noticed that the build number bump still (and randomly) bumps the build number incorrectly, which causes build errors. I have therefore abandoned this approach, and instead fixes the build number to 1 in all targets.
This version aim at streamlining the library and remove or refactor parts that make it hard to maintain. It contains several breaking changes, but I hope that the changes will make it easier for you as well, as the library moves forward.
Most notably, the view controller inheritance model has been completely removed. Instead, there is only one KeyboardInputViewController. It has a stack view to which you can add any views you like, like the built-in KeyboardButtonRow and KeyboardCollectionView, which means that your custom keyboards is now based on components that you can combine.
Since KeyboardInputViewController therefore can display multiple keyboards at once, it doesn't make any sense to have a single keyboard property. You can still use structs to organize your actions (in fact, I recommend it - have a look at the demo app), but you don't have to.
All action handling has been moved from the view controller to KeyboardActionHandler as well. KeyboardInputViewController use a StandardActionHandler by default, but you can replace this by setting keyboardActionHandler to any KeyboardActionHandler. This is required if you want to use certain actions types, like .image.
New KeyboardActions are added and nextKeyboard has been renamed to switchKeyboard. Action equality logic has also been removed, so instead of isNone, you should use == .none from now on. All help properties like image and imageName are removed as well, since they belong in the app. These are the new action types
- capsLock
- dismissKeyboard
- moveCursorBackward
- moveCursorForward
- shift
- shiftDown
- switchToKeyboard(type)
KeyboardInputViewController will now resize the extension to the size of the stack view, or any other size constraints you may set. The old setHeight(to:) function has therefore been removed.
This version upgrades KeyboardKit to Swift 5 and has many breaking changes:
KeyboardInputViewControllerhas been renamed toKeyboardViewControllerCollectionKeyboardInputViewControllerhas been renamed toCollectionKeyboardViewControllerGridKeyboardInputViewControllerhas been renamed toGridKeyboardViewControllerKeyboardAlerterhas been renamed toKeyboardAlertToastAlerterhas been renamed toToastAlertToastAlertnow has two nested view classesViewandLabelToastAlert's two style function has changed signatureToastAlerterAppearanceis now an internalToastAlert.Appearancestruct- Most extensions have been made internal, to avoid exposing them externally
Keyboard has been given an optional ID, which can be used to uniquely identify a keyboard. This makes it easier to manage multiple keyboards in an app.
KeyboardInputViewController implements the KeyboardPresenter protocol, which means that you can set the new optional id property to make a KeyboardSetting exclusive to that presenter. This is nice if your app has multiple keyboards. If you do not specify an id, the settings behave just like before.
A PR by micazeve is merged. It limits the current page index that is persisted for a keyboard, to avoid bugs if the page count has changed since persisting the value.
This version updates KeyboardKit to Swift 4.2 and makes it ready for Xcode 10.
The grid keyboard view controller uses a new way to calculate the available item space and item size for a certain number of rows and buttons per row. This means that we can now use top and bottom content insets to create vertical margins for grid-based keyboards.
I previously used the async image functions to quickly setup a lot of images for "emoji" keyboards. Since I didn't use a collection view for emoji keyboards then, all image views were created at the same time, which caused rendering delays. By using the async image approach, image loading was moved from the main thread and allowed individual images to appear when they were loaded instead of waiting for all images to load before any image could be displayed.
However, KeyboardKit now has collection view-based keyboards, which are better suited for the task above, since they only render the cells they need. This will solve the image loading issues, which means that the async image extensions will no longer be needed. I have therefore removed UIImage+Async and the Threading folder from the library, to keep it as small as possible.
No functional changes, just README updates and improvements. The version bump is required to give CocoaPod users the latest docs.
This is a complete rewrite of the entire library. KeyboardKit now targets iOS 11 and the code has been improved a lot. Check out the demo app to see how to setup keyboards from now on.