KeyboardKit tries to honor semantic versioning:
- Only remove deprecated code in
major
versions. - Only deprecate code in
minor
andpatch
versions. - Avoid breaking changes in
minor
andpatch
versions. - Code can be marked as deprecated at any time.
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.
Older versions are kept in the Release_Notes
folder.
This version adds a first PREVIEW of dictation support. It's a very early version that is not yet tested, but your feedback is very important if you try it out.
This version adds a bunch of new themes with new style variations, which means that you can easily tweak a theme-specific set of parameters for the various themes.
This version introduces breaking changes with reference to "Breaking changes can still occur in minor versions and patches...".
In this case, the benefits are massive, since it lets us make many more types Codable
and Equatable
, which unlocks more capabilities.
This requires that the types can't contain non-codable types, such as Image
or Font
, which requires breaking changes to the current setup.
Types that have Image
properties will instead use raw Data
, while types that have Font
properties will use a new KeyboardFont
property.
KeyboardFont
can be created in the same way as Font
but if you want to use it with a SwiftUI view modifier, you have to use .font(font.font)
.
Just reach out if these breaking changes cause problems.
Dictation
is a new namespace with PREVIEW types that defines how to perform keyboard dictation.KeyboardBackgroundStyle
has a new convenience initializer.KeyboardBackgroundType
has been extracted fromKeyboardBackgroundStyle.BackgroundType
.KeyboardBackgroundType
has a new.clear
type.KeyboardBackgroundType
has a new.verticalGradient
type.KeyboardFont
is a newCodable
type that is used to make the various styles codable.KeyboardFontType
is a newCodable
type that is used to make the various styles codable.KeyboardFontWeight
is a newCodable
type that is used to make the various styles codable.KeyboardInputViewController
has adictationContext
that can be used to manage and observe dictation state.KeyboardInputViewController
has adictationService
that can be used to start dictation from your keyboard.KeyboardInputViewController
has re-added the oldhostBundleId
property, which can be used to get the ID of the parent app.
AutocompleteToolbarStyle
AutocompleteToolbarItemStyle
AutocompleteToolbarItemBackgroundStyle
AutocompleteToolbarStyle
KeyboardActionCalloutStyle
KeyboardInputCalloutStyle
KeyboardBackgroundStyle
KeyboardBackgroundType
KeyboardButtonStyle
KeyboardButtonShadowStyle
KeyboardCalloutStyle
KeyboardInputCalloutStyle
KeyboardTheme
KeyboardTheme
has a newstyleName
property.KeyboardTheme
can now support style variations.KeyboardTheme
has many new themes with style variations.KeyboardTheme
has a newgrouped
function that groups themes into named collections.KeyboardThemeCollection
is a new type that can be used to group themes into named collections.PreviousAppNavigator
is a new protocol that can be implemented by any type that should be able to navigate back to the previous app.StandardDictationService
is a new service that can be used to perform dictation within an app target.StandardKeyboardDictationService
is a new service that can be used to start dictation from a keyboard extension.
- The pressed system keyboard button color overlay is now clipped to the button corner radius.
KeyboardTheme.cottonCandy
has been renamed toKeyboardTheme.candy(.cottonCandy)
.KeyboardTheme.neonNights
has been renamed toKeyboardTheme.neon(.night)
.
AutocompleteToolbarItemStyle
fonts are now of typeKeyboardFontStyle
.KeyboardBackgroundType
no longer has a.linearGradient
type.KeyboardBackgroundType
now requiresData
for.image
instead of a SwiftUIImage
.KeyboardActionCalloutStyle
font
is now of typeKeyboardFontStyle
.KeyboardInputCalloutStyle
calloutPadding
is now of typeCGFloat
.KeyboardInputCalloutStyle
font
is now of typeKeyboardFontStyle
.KeyboardTheme
no longer defines insets, but will instead make the bottom shadow fit the screen.LicenseTier
has removed thekk
name prefix and thecom.keyboardkit.
ID prefix.
- The new, experimental autocomplete provider fixes a localization sync bug.
This version focuses on making it easier to style keyboards.
This version adds a theme engine to KeyboardKit Pro. The new KeyboardThemeAppearance
can be used with the new KeyboardTheme
to style keyboards with themes, which is a lot easier than defining custom appearances.
This version comes with three themes - .cottonCandy
, .neonNights
and .tron
. You can use them in your own keyboads, or tweak them to create your own visual styles. More themes are coming in future versions.
Due to a bug found in the new autocomplete provider, the old StandardAutocompleteProvider
will be replaced in the next minor version.
AutocompleteContext
has a newisEnabled
property that can be used to disable autocomplete.KeyboardAppearance
has a newautocompleteToolbarStyle
property.KeyboardAppearance
has a newkeyboardBackground
property.KeyboardBackgroundStyle
is a new style that can be used to the background of a keyboard.KeyboardButtonStyle
properties are now optional to allow for overrides.KeyboardButtonStyle
has a newpressedOverlayColor
property that can be used to highlight buttons.KeyboardButtonStyle
has a newextended(with:)
function to let you extend a style with another style.View+SystemKeyboardButton
has a newisPressed
parameter to let you define pressed state.
KeyboardInputViewController
will use the new autocomplete context property to disable autocomplete if needed.KeyboardTheme
is a new type that can be used to define keyboard themes.KeyboardThemeAppearance
is a new appearance that can be used withKeyboardTheme
.- The new
LocalAutocompleteProvider
that was introduced in 7.1 has been made public. - The new
LocalAutocompleteProvider
now ignores empty strings when wrapping in quotes. - The new
LocalAutocompleteProvider
now replaces hyphens with space when suggesting splitting up the word. - The incorrect Brazilian callout actions have been corrected.
KeyboardTheme.cottonCandy
is a pink and blue trip to fluffy delight.KeyboardTheme.neonNights
is a metropolitian color explosion.KeyboardTheme.tron
is a black and blue, digital adrenaline rush.
SystemKeyboard
uses the new appearance background and autocomplete toolbar styles.
CalloutStyle
has been renamed toKeyboardCalloutStyle
.ActionCalloutStyle
has been renamed toKeyboardActionCalloutStyle
.InputCalloutStyle
has been renamed toKeyboardInputCalloutStyle
.
This version adds an isKeyboardFloating
property to the keyboard context. It's currently not used to change the visual representation of floating keyboards, but please verify that it works as expected.
KeyboardContext
has a newisKeyboardFloating
property that can be used to determine if the keyboard is floating.
GestureButtonDefaults
have adjustedrepeatDelay
to0.5
.
KeyboardLayoutConfiguration
now applies Pro Max configuration to iPhone 14 Pro Max.SystemKeyboard
will now show autocomplete in Twitter and Mastodon.View+KeyboardGestures
will now trigger repeating actions like backspace more like the native keyboards.
This version fixes some bugs in KeyboardTextField
and KeyboardTextView
and tweaks their behavior a bit.
The demo app has a new KeyboardTextInput
demo keyboard that shows KeyboardTextField
and KeyboardTextView
in action.
KeyboardInputView
is a new protocol that lets you apply afocused
binding together with a custom done button.
KeyboardTextField
andKeyboardTextView
now implement the newKeyboardInputView
protocol.KeyboardTextField
andKeyboardTextView
now apply a basic style before applying any custom configuration.KeyboardTextField
andKeyboardTextView
now animates together with the focused state.KeyboardTextField
now applies a background color and border style.KeyboardTextView
now applies a background color, corner radius and font.KeyboardTextView
now uses the same font asKeyboardTextField
by default.
KeyboardTextField
andKeyboardTextView
now correctly resigns as first responder when they lose focus.
This version fixes some bugs and makes it even easier to setup KeyboardKit.
KeyboardKit Pro also has a new experimental and much better autocomplete provider that you can toggle on with the FeatureToggle
:
FeatureToggle.shared.toggleFeature(.newAutocompleteEngine, .on)
Once this has been verified to work better than the current provider, it will replace it and this feature toggle flag will be removed.
Furthermore, the locale context menu has been refactored to work and look a lot better on iOS 16 and macOS 12. This unfortunately required a few breaking api changes, that hopefully will not affect anyone.
FeatureToggle
has a new.newAutocompleteEngine
feature.KeyboardContext
has a newlocalePresentationLocale
property.KeyboardInputViewController
has newsetup
functions that provide a view builder with an unowned controller reference.QuotationAnalyzer
has more functions.String
has new quotation functions.
- KeyboardKit Pro has a new experimental autocomplete provider that can be toggled on to replace the standard one.
- Many iPad layouts have been tweaked to look even closer to the native layouts.
KeyboardInputViewController
setup
uses a view builder instead of a static view.KeyboardInputViewController
now callsviewWillSetupKeyboard
inviewWillAppear
instead ofviewDidLoad
.KeyboardRootView
uses a view builder instead of a static view.
iPadKeyboardLayoutProvider
had a line accidentally removed, which caused English layouts to render incorrect. This has been fixed.KeyboardInputViewController
now creates the keyboard view later, which makes it respect the safe areas better in landscape.LocaleContextMenu
now uses theKeyboardContext
to localize and sort locales.
SpaceLongPressBehavior
cases have been renamed to read better. This should hopefully affect few people.
KeyboardKit 7.0 involves a major rewrite that aims to bring more consistency in naming and structure and to streamline the library to make future development easier. It bumps the platform deployment targets to iOS 14, macOS 11, tvOS 14 and watchOS 7 and removes all previously deprecated code and todos.
Although KeyboardKit 7.0 aims to introduce as few breaking changes as possible, there are some surface level APIs that will change. Some such changes are the removal of many shared instances and how more dependencies have to be passed in as parameters. If you are using the now removed shared instances, simply inject the instance as initializer or function parameter instead.
KeyboardKit 7.0 makes the SystemKeyboard
easier to use, where it now adds an autocomplete toolbar by default to make sure that the callouts has enough space, and to reduce the risk of memory leaks that was previously easy to add by accident when you connected the toolbar to the keyboard input controller's autocomplete function. If your keyboard uses a custom autocomplete toolbar, you must pass in autocompleteToolbar: none
in the system keyboard initializer.
If you have problems upgrading to 7.0
, first try upgrading to 6.9
. It has a lot of deprecations in place to provide guidance. You may still experience breaking changes after that, but they will be fewer.
AutocompleteContext
has a newreset
function.AutocompleteToolbar
is now available on all platforms.EmojiAnalyzer
is a new protocol that mergesEmojiCharacterAnalyzer
andEmojiStringAnalyzer
.EmojiCategoryKeyboard
is now available on all platforms.EmojiCategoryKeyboardMenu
is now available on all platforms.EmojiCategoryTitle
is now available on all platforms.EmojiKeyboard
is now available on all platforms.EmojiKeyboardStyle
has new context-based standard functions.ExternalKeyboardContext
is now available on macOS and tvOS as well.GestureButton
is now available on watchOS 7.Image
.keyboardEmojiSymbol
provides the old emoji keyboard button icon.InterfaceOrientation
has a newlandscape
case.KeyboardAction
gesture actions are now available on all platforms.KeyboardAction
gesture actions now use aKeyboardController
instead of aKeyboardInputViewController
.KeyboardAppearance
will now apply to.nextKeyboard
as well.KeyboardCalloutContext
is a new context that lets lets us pass around a single context for input and action callouts.KeyboardCharacterProvider
is a new protocol that provides keyboard-specific characters.KeyboardController
is a new protocol that lets us decouple actions from the input view controller.KeyboardContext
has a newkeyboardLocale
and new functions for setting locale and keyboard type.KeyboardContext
has a newspaceLongPressBehavior
property to control the space button's behavior.KeyboardInputViewController
has a newcalloutContext
.KeyboardInputViewController
implementsKeyboardController
which gives it a bunch of new functions.KeyboardLocale
implementsLocaleFlagProvider
.KeyboardLocale
has newLocale
matching extensions.KeyboardType
has new properties.KeyboardLayoutConfiguration
has adjusted the standard corner radius for iPhone buttons.Locale
has new localized name extensions.Locale
has newKeyboardLocale
matching extensions.LocaleContextMenu
now lets you customize the presentaiton locale.NextKeyboardButton
now supports using any custom content.NextKeyboardController
is used instead of the shared controller.QuotationAnalyzer
is a new protocol for analyzing quotations in strings.ScrollViewGestureButton
is now available on watchOS 7.SpaceCursorDragGestureHandler
is now available on all platforms.SpaceLongPressBehavior
is a new enum that defined the available space long press behaviors.String
has new casing, keyboard character, quotation, word and sentence extensions.SystemKeyboard
will now add an autocomplete toolbar by default.SystemKeyboardButton
is now available on all platforms.Text
is a new namespace for text analysis.UITextDocumentProxy
quotation utilities is now available asStringQuotationAnalyzer
.
FeedbackToggle
is a new button to toggle audio and haptic feedback.AudioFeedbackToggleButton
has been replaced withFeedbackToggle
.HapticFeedbackToggleButton
has been replaced withFeedbackToggle
.
ActionCallout
is no longer greedy.CalloutStyle
has a new standard corner radius.InputCallout
is no longer greedy.InterfaceOrientation
.current
now returns correct rotations on all platforms.iPadKeyboardLayoutProvider
has been greatly simplified.iPhoneKeyboardLayoutProvider
has been greatly simplified.Image
.keyboardEmoji
is looks closer to the native icon.KeyboardAction
.backspace
now triggers on.press
instead of.release
.KeyboardLayoutConfiguration
now behaves the same on all platforms.KeyboardSettingsLink
has ben rewritten to only use plain SwiftUI code that works with extensions as well.StandardKeyboardAppearance
now applies medium font weights to the Gregorian ABC keyboard.
- All deprecated code has been removed.
- The library now targets iOS 14, macOS 11, tvOS 14 and watchOS 7.
ActionCalloutContext
.shared
has been removed.AutocompleteSuggestions
is now a struct instead of a protocol.AutocompleteToolbar
standard actions have been removed.AutocompleteToolbar
ReplacementAction
has been renamed toSuggestionAction
.AutocompleteToolbarItem
init parameters have been reordered.AutocompleteToolbarItemTitle
init parameters have been reordered.DeleteBackwardRange
char
has been renamed tocharacter
.EmojiCategoryKeyboard
init parameters have been refactored.EmojiCategoryKeyboardMenu
init parameters have been reordered.EmojiCharacterAnalyzer
andEmojiStringAnalyzer
have been merged intoEmojiAnalyzer
.EmojiKeyboard
init parameters have been refactored.InputCalloutContext
.shared
has been removed.InputSet
has been converted to aprotocol
and all input set types converted fromclass
tostruct
.KeyboardAction
.return
and.newLine
have been replaced byprimary
variants.KeyboardAction
.shift
currentState
is renamed tocurrentCasing
.KeyboardAction
standardTextDocumentProxyAction
has been removed.KeyboardAppearance
callout styles have been converted to properties.KeyboardContext
originalTextDocumentProxy
has been renamed tomainTextDocumentProxy
.KeyboardGesture
.tap
has been replaced by.release
.KeyboardInputViewController
has replacedactionCalloutContext
andinputCalloutContext
with a singlecalloutContext
.KeyboardInputViewController
.shared
has been removed.KeyboardInputViewController
originalTextDocumentProxy
has been renamed tomainTextDocumentProxy
.KeyboardLayoutConfiguration
portrait configurations have been renamed.KeyboardReturnActionMappable
has been refactored toKeyboardActionMappable
.KeyboardTextField
now requires an keyboard input view controller.KeyboardTextView
now requires an keyboard input view controller.KeyboardType
has made theisAlphabetic(with:)
parameter implicit.Locale
regionIdentifier
has been removed.LocaleProvider
has been removed.LocaleFlagProvider
is now only implemented byLocale
on iOS 16.StandardAutocompleteSuggestions
has been renamed toAutocompleteSuggestions
.StandardKeyboardActionHandler
now requires aKeyboardController
.StandardKeyboardActionHandler
inputViewController
initializer is now a convenience initializer.StandardKeyboardActionHandler
changeKeyboardTypeAction
has been removed.StringCasingAnalyzer
has been renamed toCasingAnalyzer
.StringCasingAnalyzer
has replaced properties with functions.SystemKeyboard
init parameters have been refactored.SystemKeyboard
standardKeyboardWidth
has been removed.SystemKeyboardActionButton
has been renamed toSystemKeyboardButton
and requires a callout context.SystemKeyboardActionButtonContent
has been renamed toSystemKeyboardButtonContent
.SystemKeyboardButton
has been replaced by the renamed action button.SystemKeyboardButtonRowItem
now requires a callout context.UITextDocumentProxy
isOpenQuotationBeforeInput
has been renamed tohasUnclosedQuotationBeforeInput
.UITextDocumentProxy
isOpenAlternateQuotationBeforeInput
has been renamed tohasUnclosedAlternateQuotationBeforeInput
.UITextDocumentProxy
preferredReplacement
is renamed topreferredQuotationReplacement
.View
.keyboardGestures
now requires a callout context.