KeyboardKit

KeyboardKit is a Swift SDK that lets you create fully customizable keyboards with a few lines of code, using SwiftUI.

MIT License

Stars
1.5K
Committers
29

Bot releases are hidden (Show)

KeyboardKit -

Published by danielsaidi over 3 years ago

โœจ New features

  • KeyboardCasing has a new auto case.

๐Ÿ’ก Behavior changes

  • SystemKeyboardLayoutProvider uses the new auto case for numeric and symbolic keyboard type switches.

๐Ÿ› Bug fixes

  • This version fixes a bug that caused numeric and symbolid keyboards to always switch back to lowercased alphabetic keyboards.

๐Ÿ—‘ Deprecations (removed in 5.0)

  • BaseKeyboardLayoutProvider has been renamed to SystemKeyboardLayoutProvider.
  • KeyboardCasing.neutral will be removed in KeyboardKit 5.0.
KeyboardKit -

Published by danielsaidi over 3 years ago

โœจ New features

  • StandardKeyboardActionHandler canHandle is now open instead of public.
KeyboardKit -

Published by danielsaidi over 3 years ago

๐Ÿ’ก Behavior changes

  • KeyboardGestures now 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.
  • KeyboardGestures now 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.

๐Ÿ› Bug fixes

  • This version fixes compile errors in Xcode 12.4.

๐Ÿ—‘ Deprecations (removed in 5.0)

  • Image.settings has been renamed to keyboardSettings.
  • Image.moveCursorLeft/Right have been renamed to keyboardLeft/Right.
KeyboardKit -

Published by danielsaidi over 3 years ago

This patch fixes a bug that caused the keyboard layout to not update.

KeyboardKit -

Published by danielsaidi over 3 years ago

This patch fixes a bug that caused the secondary actions to not update.

KeyboardKit -

Published by danielsaidi over 3 years ago

This version adds new locales, external keyboard detection, dynamic type disabling and RTL locale support.

โœจ New features

  • ExternalKeyboardContext is a new iOS 14 exclusive class that lets you observe whether or not an external keyboard is connected to the device.
  • KeyboardAction has a new standardButtonFontSize function.
  • KeyboardType has a new, context-based standardButtonImage function that replaces the old property.
  • KeyboardLocale has new isLeftToRight and isRightToLeft properties.
  • KeyboardType has a new standardButtonFontSize function.
  • KeyboardType has a new, context-based standardButtonText function that replaces the old property.
  • Locale has new characterDirection and lineDirection properties.
  • Locale has new isLeftToRight, isRightToLeft, isBottomToTop, isTopToBottom properties.
  • Thanks to @habaieba, KeyboardKit now has French localization.
  • There are new localizations for the keyboard type key texts.

๐ŸŒ New locales

  • ๐Ÿ‡ซ๐Ÿ‡ท French
  • ๐Ÿ‡ช๐Ÿ‡ธ Spanish

๐Ÿ’ก Behavior changes

  • KeyboardAction now flips the standard keyboard button image for RTL locales.
  • SystemKeyboard will now ignore dynamic type, just like the native keyboards.

๐Ÿ› Bug fixes

  • The German localized newline symbol for Return is now correctly rendered as an image.

๐Ÿ—‘ Deprecated (removed in 5.0)

  • KeyboardAction standardButtonFont has been renamed to standardButtonUIFont.
  • KeyboardAction standardButtonFontWeight has been renamed to standardButtonUIFontWeight.
  • KeyboardAction standardButtonImage has been converted to a context-based function.
  • KeyboardType standardButtonText has been converted to a context-based function.
  • UIApplication standardButtonTextStyle has been renamed to standardButtonUITextStyle.

๐Ÿ’ฅ Breaking changes

  • KeyboardAction+standardButtonFont now returns a Font instead of a UIFont.
  • KeyboardAction+standardButtonFontWeight now returns a Font.Weight instead of a UIFont.Weight.
  • KeyboardAction standardButtonImage - the property is deprecated in favor for the context-based function.
  • The old properties are now called standardButtonUIFont and standardButtonUIFontWeight.
KeyboardKit - 4.4.0

Published by danielsaidi over 3 years ago

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.

โœจ New features

  • CGFloat has a new standardKeyboardButtonCornerRadius property.

  • DeleteBackwardRange is a new enum can be used when deleting backwards.

  • EnglishKeyboardInputSetProvider has new currency init params.

  • KeyboardAction.PrimaryType has new newLine case, that can be used to force an arrow for primary buttons.

  • KeyboardBehavior has a new backspaceRange property.

  • KeyboardColor is a new enum that exposes the raw color resources.

  • KeyboardContext has a new activeAppBundleId property that identifies the currently active app.

  • KeyboardContext has a new screenOrientation property that replaces deviceOrientation.

  • KeyboardPreviewMode is a new (hopefully temporary) class that has a static enable() function that makes SwiftUI previews work.

  • KeyboardInputViewController has a new activeAppBundleId property that identifies the currently active app.

  • RepeatGestureTimer has been made public and can be used to inspect how long a repeat gesture has been active.

  • RowItem is a new protocol that makes it possible to gather row collection functions in one place - Collection+RowItem.

  • Collection+RowItem has new extensions that make it easier to add and remove row items to all collections that contain the new RowItem protocol.

  • EdgeInsets+Keyboard has new context-based extensions.

  • UIInputViewController+Orientation renames deviceOrientation to screenOrientation.

  • UITextDocumentProxy+Delete has a new extension for deleting backwards a certain range.

๐ŸŒ New locales

  • ๐Ÿ‡ฌ๐Ÿ‡ง English U.K. (GB)
  • ๐Ÿ‡บ๐Ÿ‡ธ English U.S. (same keyboard as base English but different region)

๐Ÿ’ก Behavior changes

  • KeyboardAction now implements RowItem.

  • iPadKeyboardLayoutProvider has been adjusted layout buttons closer to native layouts.

  • iPhoneKeyboardLayoutProvider has been adjusted layout buttons closer to native layouts.

  • KeyboardInput now implements RowItem.

  • KeyboardLayoutItem now implements RowItem.

  • StandardKeyboardBehavior now only auto-switches keyboard type on .tap.

  • UITextDocumentProxy handles 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.

๐Ÿ—‘ Deprecated (removed in 5.0):

  • KeyboardContext deviceOrientation has been renamed to screenOrientation.
  • UIApplication preferredKeyboardInterfaceOrientation didn't work and will be removed.
  • UIDeviceOrientation interfaceOrientation is no longer used and will be removed.
  • UIInputViewController deviceOrientation has been renamed to screenOrientation.
  • UIInterfaceOrientation - the device orientation-based init is no longer used and will be removed.

๐Ÿ’ฅ Breaking changes:

  • KeyboardBehavior has a new backspaceRange property 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.

KeyboardKit -

Published by danielsaidi over 3 years ago

This version tweaks KeyboardGestures to avoid delays.

KeyboardKit -

Published by danielsaidi over 3 years ago

This version introduces a bunch of changes to how feedback is being handled.

โœจ New features

  • AudioFeedbackConfiguration has default init param values.
  • DragGestureHandler is a new protocol for handling drag gestures.
  • HapticFeedbackPlayer is a new protocol for preparing and playing haptic feedback.
  • KeyboardAction has a new standardAction(for:gesture) function.
  • KeyboardFeedbackHandler is a new protocol for handling keyboard feedback.
  • KeyboardFeedbackSettings is a new, observable settings object.
  • KeyboardGesture is now CaseIterable.
  • KeyboardInputViewController has a new setup(with:) that takes a UIStackView.
  • KeyboardInputViewController has a new keyboardFeedbackHandler property.
  • KeyboardInputViewController has a new keyboardFeedbackSettings property.
  • StandardHapticFeedbackPlayer is a standard implementation that is used by default.
  • StandardKeyboardActionHandler has new, cleaner initializers.
  • StandardKeyboardActionHandler has a new triggerFeedback function.
  • StandardKeyboardActionHandler has a new spaceDragGestureHandler that is used to handle space drag gestures.
  • StandardKeyboardFeedbackHandler is a new, standard feedback handler.
  • There are new mocks for the new classes.

๐Ÿ’ก Behavior changes

  • More feedback types are now Equatable.
  • Action feedback (e.g. tap sound) is now given on press instead of tap.
  • StandardKeyboardActionHandler uses the new feedback handler to trigger feedback.

๐Ÿšš Structure changes

  • Audio feedback types have been moved to Feedback.
  • Haptic feedback types have been moved to Feedback.

๐Ÿ—‘ Deprecated (removed in 5.0):

  • AudioFeedback systemPlayer has been renamed to player.
  • KeyboardInputViewController keyboardStackView has been replaced with a new setup(with:).
  • StandardKeyboardActionHandler has deprecated the two audio/haptic configuration-based initializers.
  • StandardKeyboardActionHandler audioConfiguration is deprecated and converted to a computed property.
  • StandardKeyboardActionHandler hapticConfiguration is deprecated and converted to a computed property.
  • StandardKeyboardActionHandler spaceDragSensitivity is deprecated.
  • StandardKeyboardActionHandler handleSpaceCursorDragGesture is deprecated.
  • StandardKeyboardActionHandler triggerAudioFeedback is deprecated.
  • StandardKeyboardActionHandler triggerHapticFeedback is deprecated.
  • StandardKeyboardActionHandler triggerHapticFeedbackForLongPressOnSpaceDragGesture is deprecated.
KeyboardKit -

Published by danielsaidi over 3 years ago

This version adds support for primary actions, such as .done, .go, .search etc.

โœจ New features

  • BaseKeyboardLayoutProvider has a new, open keyboardReturnAction(for:) function.
  • KeyboardAction has a new standardTextDocumentProxyAction.
  • KeyboardAction has a new standardTextDocumentProxyInputAction.
  • KeyboardAction.primary is a new action type that gathers all primary action types.
  • KKL10n has new text(for:) functions that let you translate keys for specific contexts and locales.
  • String+sentenceDelimiters and wordDelimiters can now be modified, if you have specific needs.
  • The iPhone and iPad layout providers now replaces return with done, go and search when applicable.

๐Ÿ› Bug fixes

  • English (US) secondary actions now include actions for $.

๐Ÿ’ก Changed behavior

  • New line is now considered to be a word delimiter instead of a sentence delimiter.
  • Due to the new ways to localize content, some signatures must be changed to optional strings.

๐Ÿ—‘ Deprecated (removed in 5.0):

  • KeyboardAction .done, .go, .ok and .search have been deprecated and replaced with the new primary umbrella type.
KeyboardKit -

Published by danielsaidi over 3 years ago

Milestone.

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.

โœจ New features:

  • AutocompleteSpaceState is a new enum that is used to keep track of how a
  • AutocompleteSuggestion has new isAutocomplete and isUnknown properties.
  • AutocompleteSuggestionProvider has new functions for ignoring and learning words.
  • AutocompleteToolbar has a new itemBuilder initializer.
  • AutocompleteToolbarItem is a new view that replicates a native autocomplete item.
  • AutocompleteToolbarItemText is a new view that replicates the text of a native autocomplete item.
  • KeyboardAction has a new isSpace property.
  • KeyboardAction has a new shouldApplyAutocompleteSuggestion property.
  • KeyboardAction has a new shouldReinsertAutocompleteInsertedSpace property.
  • KeyboardAction has a new shouldRemoveAutocompleteInsertedSpace property.
  • KeyboardLocale now implementes Identifiable.
  • KeyboardLocale has new flag, id and localeIdentifier properties.
  • KeyboardLocale has new sorted collection extensions.
  • KeyboardInputViewController has a new autocompleteSuggestionProvider property.
  • KeyboardInputViewController has now implemented performAutocomplete and resetAutocomplete.
  • StandardKeyboardActionHandler has a new tryApplyAutocompleteSuggestion function.
  • StandardKeyboardActionHandler has a new tryHandleReplacementAction function.
  • StandardKeyboardActionHandler has a new tryReinsertAutocompleteRemovedSpace function.
  • StandardKeyboardActionHandler has a new tryRemoveAutocompleteInsertedSpace function.
  • SystemKeyboardSpaceButtonContent has a new initializer that lets you inject a custom space view.
  • UITextDocumentProxy has a new hasAutocompleteInsertedSpace property.
  • UITextDocumentProxy has a new hasAutocompleteRemovedSpace property.
  • UITextDocumentProxy has a new insertAutocompleteSuggestion function.
  • UITextDocumentProxy has a new isOpenAlternateQuotationBeforeInput(for:) function.
  • UITextDocumentProxy has a new isOpenQuotationBeforeInput(for:) function.
  • UITextDocumentProxy has a new preferredReplacement(for:locale:) function.
  • UITextDocumentProxy has a new tryInsertSpaceAfterAutocomplete) function.
  • UITextDocumentProxy has a new tryReinsertAutocompleteRemovedSpace function.
  • UITextDocumentProxy has a new tryRemoveAutocompleteInsertedSpace function.

๐ŸŒ New locales

  • ๐Ÿ‡ฉ๐Ÿ‡ฐ Danish
  • ๐Ÿ‡ณ๐Ÿ‡ฑ Dutch
  • ๐Ÿ‡ซ๐Ÿ‡ฎ Finnish
  • ๐Ÿ‡ณ๐Ÿ‡ด Norwegian

๐Ÿ’ก Changed behavior

  • KeyboardInputViewController now uses combine observations to keep locale in sync.

๐Ÿšš Renamed:

  • AutocompleteSuggestion+replacement has been renamed to text.
  • AutocompleteToolbar+ButtonBuilder has been renamed to ItemBuilder.
  • KeyboardLocale+key has been renamed to id.
  • LocaleKey has been renamed to KeyboardLocale.

๐Ÿ—‘ Deprecated (removed in 5.0):

  • AutocompleteSuggestion+replacement has been deprecated due to the name change above.
  • AutocompleteToolbar+buttonBuilder init has been deprecated and replaced with the itemBuilder one.
  • AutocompleteToolbar+standardReplacement has been deprecated.
  • LocaleKey has been deprecated due to the name change above.
  • KeyboardLocale+key has been deprecated.
  • KeyboardInputViewController+changeKeyboardLocale has been deprecated.
  • KeyboardInputViewController+changeKeyboardType has been deprecated.

๐Ÿ’ฅ Breaking changes:

  • AutocompleteSuggestionProvider has new properties and functions that must be implemented. If you have an instance that breaks, just create dummy implementations that does nothing.
KeyboardKit -

Published by danielsaidi over 3 years ago

This patch fixes a bug with the numeric/symbolic auto-switch back to alphabetic, that could cause a keyboard to get stuck in alpha.

KeyboardKit -

Published by danielsaidi over 3 years ago

This patch fixes a few minor things:

  • ๐ŸŒ Italian localization has been added.
  • ๐ŸŒ German localization has been added.
  • ๐ŸŒ .done was 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.
KeyboardKit -

Published by danielsaidi over 3 years ago

This patch fixes a few minor things:

  • โœจ LocaleKey now implements CaseIterable.
  • ๐Ÿš‘ StandardKeyboardActionHandler had a memory leak that has been fixed.
KeyboardKit -

Published by danielsaidi over 3 years ago

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.

New features

Besides the new things listed below, there are a bunch of new extensions, images etc.

  • Callouts has new types and providers for working with callouts.
  • Image.emoji no longer requires iOS 14, but uses person.crop.circle as fallback on iOS 13.
  • Input has new types and providers for working with keyboard layouts.
  • KeyboardAction has new actions - go, nextLocale, ok and return.
  • KeyboardAction has new, localized standard button texts for some actions.
  • KeyboardAction has new isPrimaryAction property.
  • KeyboardAction has new standardButtonFontWeight property.
  • KeyboardAppearance has a new image(for:).
  • KeyboardCasing has a new neutral case that can be used to show the original state of the inputs.
  • KeyboardContext has a new locales list and a new selectNextLocale function.
  • KeyboardGesture has new press and release gestures.
  • KeyboardInput is a new input type that simplifies building unicode-based keyboards.
  • KeyboardInputSet is now based on KeyboardInputs instead of strings.
  • KeyboardInputViewController has a new static shared instance.
  • KeyboardInputViewController has a new keyboardActionHandler.
  • KeyboardInputViewController has a new keyboardAppearance.
  • KeyboardInputViewController has a new keyboardBehavior.
  • KeyboardInputViewController has a new keyboardContext.
  • KeyboardInputViewController has a new keyboardInputCalloutContext.
  • KeyboardInputViewController has a new keyboardInputSetProvider.
  • KeyboardInputViewController has a new keyboardLayoutProvider.
  • KeyboardInputViewController has a new keyboardSecondaryInputActionProvider.
  • KeyboardInputViewController has a new keyboardSecondaryInputCalloutContext.
  • KeyboardInputViewController setup(with:) is now open and overridable.
  • KeyboardEnabledState is a new observable class that keeps in sync with the keyboard enabled state.
  • KeyboardLayoutProvider has a new register(inputSetProvider:) to simplify changing global input set provider.
  • Layout has new types and providers for working with keyboard layouts.
  • Locale is a new namespace with a few new locale-specific utils.
  • LocaleDictionary is a simple dictionary wrapper to work with localized resources.
  • LocaleKey is a simple enum to gather top-level locale identifiers.
  • KKL10n is a new enum that provides localized strings from KeyboardKit.
  • SystemKeyboard now highlights buttons when typing on iPad.
  • View has new keyboardInputViewController convenience extensions.
  • View+keyboardToast has new context-based function.
  • View+localeContextMenu can 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.

Changed behavior

  • AutocompleteContext is now an observable object and not a protocol.
  • AutocompleteToolbar is now generic, which makes your .
  • AutocompleteToolbar now uses identifiable bar items, which leads to better separator handling.
  • AutocompleteToolbar now takes suggestions at init and doesn't require an environment injected AutocompleteContext.
  • AutocompleteToolbar no longer requires an environment injected ObservableKeyboardContext, nor does its builder functions.
  • EmojiCategory now uses the Emoji type instead of a char.
  • FrequentEmojiProvider now uses the Emoji type instead of a char.
  • KeyboardAction standardButtonFont has been coverted to a function.
  • KeyboardAction standardButtonText has been coverted to a function.
  • KeyboardAction standardButtonTextStyle has been coverted to a function.
  • KeyboardAction.emoji now uses the Emoji type instead of a char.
  • KeyboardAction.emojiCategory no longer has a standard tap action.
  • KeyboardActionRow standardButtonImage no longer takes a context.
  • KeyboardBehavior no longer takes a context as function input.
  • KeyboardContext is now an observable object and not a protocol.
  • KeyboardContext no longer has any services, just inspectable properties.
  • KeyboardGestures now handles the new press and release gestures.
  • KeyboardInputSetProvider implementations now provides punctuation as well.
  • KeyboardInputSetProvider no longer takes a context as function input.
  • KeyboardInputViewController context is now an ObservableKeyboardContext.
  • KeyboardInputViewController context is now called keyboardContext.
  • SecondaryCalloutActionProvider no longer takes a context as function input.
  • SecondaryInputCalloutContext no longer requires a context init parameter.
  • StandardKeyboardActionHandler no longer depends on an input view controller.
  • StandardKeyboardActionHandler now requires an injected keyboard context and behavior.
  • StandardKeyboardActionHandler now requires an injected autocomplete and keyboard change action.
  • StandardKeyboardActionHandler now handles the new press and release gestures.
  • StandardKeyboardActionHandler triggerAutocomplete is replaced by an injectable function.
  • StandardKeyboardAppearance will use isPrimaryAction to apply a blue color to those actions.
  • StandardKeyboardAppearance will fallback to the action's standard font weight instead of nil.
  • StandardKeyboardBehavior now requires an injected keyboard context.
  • StandardKeyboardInputSetProvider now requires an injected keyboard context.
  • View+KeyboardGestures now handles the new press and release gestures.

Removed/renamed

  • All unused extensions have been removed.
  • All previous deprecations have been removed.
  • All internal-only used extensions have been made internal.
  • InputCalloutContext.shared has been removed. Use the environment object instead.
  • KeyboardAction+SecondaryCalloutActions has been replaced with new Callouts/Providers providers.
  • KeyboardActionRow has been removed, since it's confusing to have two aliases for the same thing.
  • KeyboardAppearance button properties are prefixed with button.
  • KeyboardAppearance font and fontWeight have been merged into a single font property.
  • KeyboardAppearanceProvider has been renamed to KeyboardAppearance.
  • KeyboardButtonWidth has been renamed to KeyboardLayoutWidth.
  • KeyboardContext actionHandler has been moved to the input vc.
  • KeyboardContext keyboardAppearanceProvider has been moved to the input vc.
  • KeyboardContext keyboardBehavior has been moved to the input vc.
  • KeyboardContext keyboardInputSetProvider has been moved to the input vc.
  • KeyboardContext keyboardLayoutProvider has been moved to the input vc.
  • KeyboardDimensions is no longer used and has been removed.
  • KeyboardInputSet locale extensions have been removed.
  • KeyboardInputSet standard input set extensions have been removed.
  • KeyboardInputViewController addKeyboardGestures has been converted to KeyboardButton+Gestures.
  • KeyboardInputViewController context has been renamed to keyboardContext.
  • KeyboardInputViewController keyboardType has been removed - use the context directly!
  • KeyboardInputViewController setupKeyboard has been removed and moved to the UIKit demo.
  • KeyboardInputViewController+Gestures has been converted to KeyboardButton+Gestures.
  • KeyboardLayout actionRows has been renamed to items and are of a new KeyboardLayoutItemRows type.
  • KeyboardCasing has been renamed to KeyboardCasing
  • KeyboardStateInspector has been renamed to KeyboardEnabledStateInspector.
  • ObservableAutocompleteContext has been renamed to AutocompleteContext.
  • ObservableKeyboardContext has been renamed to KeyboardContext.
  • PhotosImageService and StandardPhotosImageService have been removed.
  • Settings has been entirely removed.
  • SecondaryInputCalloutContext.shared has been removed. Use the environment object instead.
  • StandardKeyboardContext has been replaced by ObservableKeyboardContext.
  • StandardKeyboardActionHandler has a new vc-based initializer.
  • StandardKeyboardActionHandler no longer takes an optional sender for keyboard actions.
  • StandardKeyboardActionHandler gesture actions has been gathered in a single action(for:on).
  • StandardKeyboardAppearanceProvider has been renamed to StandardKeyboardAppearance.
  • StandardKeyboardLayoutProvider no longer has left and right space actions. Implement this in a custom provider instead.
  • SystemKeyboardDimensions is no longer used and has been removed.
  • UIImage+pasteboard has been moved to the demo.
  • UIImage+photos has been moved to the demo.
  • UIImage+resized has been removed.
  • UIImage+tinted has been removed.
  • UIInputViewController+NextKeyboard has been made an internal extension in UIView+Keyboard.
  • View+Button "standard button" functions have been replaced by a single keyboardButtonStyle function.
  • View+ClearInteractable has been removed.
  • View keyboardAction(...) has been renamed to keyboardGestures(for: ...).
  • UIEdgeInsets+Keyboard standardKeyboardButtonInsets has been renamed to standardKeyboardButtonInsets.

UIKit changes

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 -> UIAutocompleteToolbarLabel
  • AutocompleteToolbarSeparator -> UIAutocompleteToolbarSeparator
  • AutocompleteToolbarView -> UIAutocompleteToolbar (OBS! Name change as well.)
  • HorizontalKeyboardComponent -> UIHorizontalKeyboardComponent
  • KeyboardAlert -> UIKeyboardAlert
  • KeyboardButton -> UIKeyboardButton
  • KeyboardButtonCollectionView -> UIKeyboardButtonCollectionView
  • KeyboardButtonRowCollectionView -> UIKeyboardButtonRowCollectionView
  • KeyboardButtonView -> UIKeyboardButtonView
  • KeyboardButtonRowComponent -> UIKeyboardButtonRowComponent
  • KeyboardCollectionView -> UIKeyboardCollectionView
  • KeyboardToolbarComponent -> UIKeyboardToolbarComponent
  • KeyboardToolbarView -> UIKeyboardToolbarView
  • KeyboardSpacerView -> UIKeyboardSpacerView
  • KeyboardStackViewComponent -> UIKeyboardStackViewComponent
  • PagedKeyboardComponent -> UIPagedKeyboardComponent
  • RepeatingGestureRecognizer -> UIRepeatingGestureRecognizer
  • Shadow -> UIShadow
  • ToastAlert -> 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+Keyboard is now used to apply button gestures to a view, instead of having this functionality in the view controller.
KeyboardKit -

Published by danielsaidi over 3 years ago

This release adds fake protocol implementations, to simplify creating SwiftUI previews.

The release also adds some things for the future:

  • KeyboardButtonWidth is a new way to express the width of a keyboard button.
  • View+KeyboardButtonWidth is 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.

KeyboardKit -

Published by danielsaidi over 3 years ago

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.

KeyboardKit -

Published by danielsaidi over 3 years ago

This release adds a time threshold to the end sentence action.

This release also fixes so that CalloutCurve and CustomRoundedRect handles invalid rects.

KeyboardKit -

Published by danielsaidi over 3 years ago

This release fixes so that the secondary input gesture triggers a tap if there were no secondary actions in the callout.

New features

  • Emoji is a new struct that in the future will let us work more with emojis in a more structured and type-safe way.

  • EmojiCategory now lets you register a frequentEmojiProvider, and uses that to populate the frequent category.

  • There is a new EmojiProvider protocol

  • There is a new FrequentEmojiProvider protocol

  • There is a new MostRecentEmojiProvider class

  • There is a new String+Delimiters extension with word and sentence delimiters.

  • There are new UITextDocumentProxu+Content extensions to get previous sentences and words.

  • AutocompleteToolbar has a new, static standardReplacement function.

  • AutocompleteToolbar has a new, static standardReplacementAction function.

  • AutocompleteToolbar now lets you provide an optional, custom replacementAction in init.

  • Color+Resources is a new extension that provides asset-based colors that adapt to dark mode.

  • EmojiCategoryKeyboard is a new view that lists the emojis of a selected category and a menu.

  • EmojiCategoryKeyboardMenu is a new view that lets the user select one of multiple categories.

  • EmojiKeyboard is a new view that renders a set of emojis in a lazy grid. The item action is customizable.

Behavior changes

  • EmojiCategory now implements EmojiProvider

  • EmojiCategory.frequent now returns emojis from the frequentEmojiProvider.

  • StandardKeyboardActionHandler now tries to register emojis with the EmojiCategory frequent emoji provider.

  • Color+Button uses the new asset-based colors.

  • SystemKeyboardButtonBody now only offsets small caps texts.

  • The emoji action has a filled standard image instead of an outlined one.

  • Due to a secondary callout action bug, the secondary context is now created by the vc.

Bug fixes

  • The ยด accent was accidentally used in standard numeric keyboards. It has now been replaced with โ€™, which is the correct one.

Deprecations

  • KeyboardContext.emojiCategory has been deprecated. This should be persisted by the view instead.

  • PhotosImageService and the standard implementation has been deprecated. Copy it to your own project if you want to keep on using it.

  • UIImage+Photos has been deprecated. Copy it to your own project if you want to keep on using it.

  • Some button-specific Color extensions have been deprecated.

  • View+keyboardAction(:context:) has been deprecated.

Breaking changes

  • secondaryCalloutInputProvider has been removed from KeyboardContext. It's now only in the secondary context.
KeyboardKit -

Published by danielsaidi almost 4 years ago

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.