Skip to content

Commit

Permalink
Update package and readme
Browse files Browse the repository at this point in the history
  • Loading branch information
danielsaidi committed Jan 27, 2025
1 parent 6240326 commit 6ca8a04
Show file tree
Hide file tree
Showing 3 changed files with 107 additions and 52 deletions.
4 changes: 2 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ let package = Package(
targets: [
.binaryTarget(
name: "KeyboardKitPro",
url: "https://github.com/KeyboardKit/KeyboardKit/releases/download/9.0.8/KeyboardKitPro.zip",
checksum: "5bb5bd7b973e29dda9f849b3146719eb4d6f0ca0500cba01a28b969cae12199d"
url: "https://github.com/KeyboardKit/KeyboardKit/releases/download/9.1-rc.1/KeyboardKitPro.zip",
checksum: "b3a42408ef2c276be62e153cc49d77c4142b17b7fec2ec7e872534dea2eaca80"
)
]
)
94 changes: 52 additions & 42 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,56 +46,62 @@ https://github.com/KeyboardKit/KeyboardKitPro.git

## Getting started

To use KeyboardKit in a keyboard extension, just import `KeyboardKitPro` and let your `KeyboardViewController` inherit ``KeyboardInputViewController`` instead of `UIInputViewController`:

```swift
import KeyboardKitPro

class KeyboardController: KeyboardInputViewController {}
```

This gives you access to lifecycle functions like `viewWillSetupKeyboardView`, observable state, services, etc.

The easiest way to set up KeyboardKit is to create a `KeyboardApp` value that defines information for your app:
The easiest way to set up KeyboardKit is to first create a `KeyboardApp` value for your app:

```swift
extension KeyboardApp {

static var keyboardKitDemo: Self {
static var keyboardKitDemo: KeyboardApp {
.init(
name: "KeyboardKit",
licenseKey: "keyboardkitpro-license-key",
bundleId: "com.keyboardkit.demo",
appGroupId: "group.com.keyboardkit.demo",
deepLinks: .init(app: "kkdemo://")
licenseKey: "your-key-here", // Sets up KeyboardKit Pro!
appGroupId: "group.com.keyboardkit.demo", // Sets up App Group data sync
locales: .keyboardKitSupported, // Sets up the enabled locales
autocomplete: .init( // Sets up custom autocomplete
nextWordPredictionRequest: .claude(...) // Sets up AI-based prediction
),
deepLinks: .init(app: "kkdemo://", ...) // Defines how to open the app
)
}
}
```

To set up your keyboard, just override `viewDidLoad` and call `setupPro(for:)` with your `KeyboardApp`:
Next, let your `KeyboardController` inherit ``KeyboardInputViewController`` instead of `UIInputViewController`:

```swift
import KeyboardKit

class KeyboardController: KeyboardInputViewController {}
```

This unlocks additional functions and capabilities, and injects `services` and observable `state` to the controller.

Next, override `viewDidLoad` and call `setup(for:)` with your app value, or `setupPro(for:...)` if you use KeyboardKit Pro:

```swift
class KeyboardViewController: KeyboardInputViewController {

override func viewDidLoad() {
super.viewDidLoad()
setupPro(for: .keyboardKitDemo) { result in
// Use the result or handle the error if you want

// KeyboardKit
setup(for: .keyboardKitDemo)

// 👑 KeyboardKit Pro
setup(for: .keyboardKitDemo) { result in
// If result is successful, KeyboardKit Pro is now active
// You can now customize your keyboard and tweak features
}
}
}
```

This will make `KeyboardSettings` sync data between the main app and its keyboard if an ``appGroupId`` is defined, register a KeyboardKit Pro license if a ``licenseKey`` is defined, set up dictation, deep links, etc.

To replace or customize the standard `KeyboardView` keyboard, just override `viewWillSetupKeyboardView` and call `setupKeyboardView` with the view you want to use:
To replace or customize the standard `KeyboardView` keyboard view, just override `viewWillSetupKeyboardView` and call `setupKeyboardView` with the view you want to use:

```swift
class KeyboardViewController: KeyboardInputViewController {

override func viewWillSetupKeyboardView() {
super.viewWillSetupKeyboardView()
setupKeyboardView { [weak self] controller in // <-- Use weak or unknowned self!
KeyboardView(
state: controller.state,
Expand All @@ -104,18 +110,20 @@ class KeyboardViewController: KeyboardInputViewController {
buttonView: { $0.view },
collapsedView: { $0.view },
emojiKeyboard: { $0.view },
toolbar: { _ in MyCustomToolbar() }
toolbar: { $0.view }
)
}
}
}
```

To set up your main app with the same configuration, just wrap the root content view in a `KeyboardAppView`:
You can return `$0.view` to use the standard view, or return any custom view you like for the provided parameters.

To set up your main app with the same keyboard configuration, just wrap the content view in a `KeyboardAppView`:

```swift
import SwiftUI
import KeyboardKitPro
import KeyboardKit

@main
struct MyApp: App {
Expand All @@ -139,29 +147,30 @@ For more information, see the [getting started guide][Getting-Started].

## Localization

KeyboardKit supports [70 keyboard-specific locales][Localization]:
KeyboardKit supports [71 keyboard-specific locales][Localization]:

🇺🇸 🇦🇱 🇦🇪 🇦🇲 🇧🇾 🇧🇬 🇦🇩 🏳️ 🇭🇷 🇨🇿 <br />
🇩🇰 🇳🇱 🇧🇪 🇦🇺 🇨🇦 🇬🇧 🇺🇸 🇪🇪 🇫🇴 🇵🇭 <br />
🇫🇮 🇫🇷 🇨🇦 🇧🇪 🇨🇭 🇬🇪 🇩🇪 🇦🇹 🇨🇭 🇬🇷 <br />
🇺🇸 🇮🇱 🇭🇺 🇮🇸 🏳️ 🇮🇩 🇮🇪 🇮🇹 🇰🇿 🇹🇯 <br />
🇹🇯 🇹🇯 🇱🇻 🇱🇹 🇲🇰 🇲🇾 🇲🇹 🇲🇳 🏳️ 🇳🇴 <br />
🇳🇴 🇮🇷 🇵🇱 🇵🇹 🇧🇷 🇷🇴 🇷🇺 🇷🇸 🇷🇸 🇸🇰 <br />
🇸🇮 🇪🇸 🇦🇷 🇲🇽 🇸🇪 🇰🇪 🇹🇷 🇺🇦 🇺🇿 🏴󠁧󠁢󠁷󠁬󠁳󠁿 <br />
🇺🇸 🇦🇱 🇦🇪 🇦🇲 🇧🇾 🇧🇬 🇦🇩 🏳️ 🏳️ 🇭🇷 <br />
🇨🇿 🇩🇰 🇳🇱 🇧🇪 🇦🇺 🇨🇦 🇬🇧 🇺🇸 🇪🇪 🇫🇴 <br />
🇵🇭 🇫🇮 🇫🇷 🇨🇦 🇧🇪 🇨🇭 🇬🇪 🇩🇪 🇦🇹 🇨🇭 <br />
🇬🇷 🇺🇸 🇮🇱 🇭🇺 🇮🇸 🏳️ 🇮🇩 🇮🇪 🇮🇹 🇰🇿 <br />
🇹🇯 🇹🇯 🇹🇯 🇱🇻 🇱🇹 🇲🇰 🇲🇾 🇲🇹 🇲🇳 🏳️ <br />
🇳🇴 🇳🇴 🇮🇷 🇵🇱 🇵🇹 🇧🇷 🇷🇴 🇷🇺 🇷🇸 🇷🇸 <br />
🇸🇰 🇸🇮 🇪🇸 🇦🇷 🇲🇽 🇸🇪 🇰🇪 🇹🇷 🇺🇦 🇺🇿 <br />
🏴󠁧󠁢󠁷󠁬󠁳󠁿 <br />

KeyboardKit Pro unlocks localized keyboards, layouts, callouts and behaviors for all supported locales.
KeyboardKit only includes localized strings, while KeyboardKit Pro unlocks localized keyboards, layouts, callouts and behaviors for all supported locales.



## Open-Source Features

[KeyboardKit][KeyboardKit] comes packed with free, open-source features to help you build amazing custom keyboards:
[KeyboardKit][KeyboardKit] has open-source features that help you build great keyboards:



## 👑 Pro Features

[KeyboardKit Pro][Pro] extends KeyboardKit with Pro features:
[KeyboardKit Pro][Pro] extends KeyboardKit with Pro features that take your keyboard further:

* ⌨️ [Essentials][Essentials] - More essential tools, previews, toolbars, etc.
* 🤖 [AI][AI] - Features that are needed for AI.
Expand All @@ -183,15 +192,15 @@ KeyboardKit Pro unlocks localized keyboards, layouts, callouts and behaviors for

## Documentation

The [online documentation][Documentation] has a detailed article for each feature, a thorough getting-started guide, code samples, etc. You can also build it from the source code to get better formatting.
The [online documentation][Documentation] has a thorough getting-started guide, a detailed article for each feature, code samples, etc. You can also build it from the source code to get better formatting.



## Demo App

The [main repository][KeyboardKit] has a demo app that shows how to set up the main keyboard app, show keyboard status, provide in-app settings, link to system settings, apply custom styles, etc.

The app has two keyboards - a `Keyboard` that uses KeyboardKit and a `KeyboardPro` that uses KeyboardKit Pro. Note that you need to enable Full Access for some features to work, like haptic feedback.
The app has two keyboards - a `Keyboard` that uses KeyboardKit and a `KeyboardPro` that uses KeyboardKit Pro. Note that you need to enable Full Access for some features to work.

> [!IMPORTANT]
> The demo isn't code signed and can therefore not use an App Group to sync settings between the app and its keyboards. As such, the `KeyboardPro` keyboard has settings screens in the keyboard as well.
Expand Down Expand Up @@ -235,9 +244,10 @@ KeyboardKit Pro requires a license to be used. You can sign up on the [KeyboardK
[Gumroad]: https://kankoda.gumroad.com
[License]: https://github.com/KeyboardKit/KeyboardKitPro/blob/master/LICENSE

[Documentation]: https://keyboardkit.github.io/KeyboardKitPro/documentation/keyboardkitpro/
[Getting-Started]: https://keyboardkit.github.io/KeyboardKitPro/documentation/keyboardkitpro/getting-started-article
[Essentials]: https://keyboardkit.github.io/KeyboardKitPro/documentation/keyboardkitpro/essentials-article
[Documentation]: https://keyboardkit.github.io/KeyboardKitPro/

[Getting-Started]: https://keyboardkit.github.io/KeyboardKitPro/documentation/keyboardkitpro/getting-started-guide
[Memory-Management]: https://keyboardkit.github.io/KeyboardKitPro/documentation/keyboardkitpro/memory-management-guide

[Actions]: https://keyboardkit.github.io/KeyboardKitPro/documentation/keyboardkitpro/actions-article
[AI]: https://keyboardkit.github.io/KeyboardKitPro/documentation/keyboardkitpro/ai-article
Expand Down
61 changes: 53 additions & 8 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,63 @@ KeyboardKit tries to honor semantic versioning:
* Breaking changes should not occur in `minor` and `patch` updates.
* Breaking changes *can* occur in `minor` and `patch` updates, if needed.

These release notes cover the current major version. Check out version tags for older release notes.
These release notes cover the current major version. Check out version tags for older release notes.


## 💡 KeyboardKit 9 Migration Guide

When migrating from KeyboardKit 8 to 9, first upgrade to the last 8 version and fix all deprecation warnings. This helps you prepare for KeyboardKit 9.
## 9.1

When you have fixed all migration warnings, upgrade to KeyboardKit 9.0 and fix any migration deprecations to conform to its many architectural changes.
> [!IMPORTANT]
> This version removes the KeyboardKit 8 migration support! Migrate to the last 9.0 version before updating to 9.1 or later.
Once you've fixed all warnings, you can start using KeyboardKit 9. You can now setup SPM to use the latest major version number, i.e. the latest 9.x version.
This version makes it easier to set up a custom `KeyboardApp`, by removing the need to specify the application `bundleId`.

The legacy migrations will be removed in 9.1, so make sure to first upgrade to 9.0 when migrating from KeyboardKit 8, before you upgrade to any later versions.
This version makes it possible to dock the keyboard to the leading or trailing edge, to simplify one handed typing on iPhone.

This version makes it possible to add a locale context menu directly to the spacebar, instead of using an extra keyboard key.

### ✨ Features

* `Keyboard.DockEdge` is a new enum that can be used to enable keyboard docking.
* `Keyboard.Settings` has a new `keyboardDockEdge` that enables keyboard docking.
* `Keyboard.SpaceLongPressBehavior` has a new `.moveInputCursorWithLocaleSwitcher`.
* `KeyboardContext` has new `enabledLocales` that usess `addedLocales` or `locales`.
* `KeyboardView` can now docks to any horizontal edge, if `keyboardDockEdge` is set.
* `KeyboardView` now automatically augments emoji keyboard styles for input toolbars.
* `Locale` has a new `shortDisplayName` that returns the language code or identifier.
* `View` has a new `.keyboardDockEdge(...)` modifier, which can apply a custom value.

### 👑 Pro

* `EmojiKeyboard` now renders a lot better for more device types.
* `Emoji.KeyboardMenu` now gets a style builder from the environment.
* `iPadProLayoutService` now renders URL and email keyboard keys better.

### 💡 Adjustment

* Many types now conform to `Codable`, `Sendable` and other essential protocols.
* Upper-case shift and caps-lock has adjusted, default idle colors in dark mode.
* `KeyboardApp` no longer needs you to define `bundleId` and `keyboardBundleId`.
* `KeyboardLayout` & `BaseLayoutService` removes `number` from input toolbar naming.

### 🇪🇸 Localization

* All emojis and emoji catetegories have been localized in Spanish.

### 🐛 Bug Fixes

* `Keyboard.KeyboardType.URL` now renders input keys and bottom actions correctly.
* `KeyboardView` doesn't remove the emoji key if a custom `emojiKeyboard` is used.

### 📄 Documentation

* The documentation has been updated with more information and examples.

### 🗑️ Deprecations

* All migration deprecations have been removed.
* `Gestures` space models have been moved to `Keyboard`.
* `KeyboardLayout.ipadProLayout` has been renamed to `isIpadProLayout`.



Expand All @@ -28,12 +73,12 @@ This version provides some minor bug fixes and improvements.

### 💡 Adjustments

* `Keryboard.Settings` now enables haptic feedback by default, since it's much better.
* `Keyboard.Settings` now enables haptic feedback by default, since it's much better.
* `Locale.ContextMenu` now sorts the listed locales in the locale presentation locale.

### 👑 Pro

* Fixed outdated platform version information in the distribution package manifest file.
Fixed outdated platform version information in the distribution package manifest file.

### 🐛 Bug Fixes

Expand Down

0 comments on commit 6ca8a04

Please sign in to comment.