A custom keyboard component for tvOS app development.
- This tvOS Keyboard can be used in any UIViewController.
- You can enter text, numbers, and other characters using the touchpad.
- Support for all input languages.
- The keyboard style is almost identical to the native component, but can be changed if the developer wishes.
- Ability to specify a focus element for switching from a component.
The Swift Package Manager is a tool for automating the distribution of Swift code and is integrated into the swift
compiler. It is in early development, but Alamofire does support its use on supported platforms.
Once you have your Swift package set up, adding TVOSKeyboard as a dependency is as easy as adding it to the dependencies
value of your Package.swift
.
dependencies: [
.package(url: "https://github.com/goldenplan/TVOSKeyboard", .upToNextMajor(from: "0.1.0"))
]
With the powerful options, you can do hard tasks with tvOS Keyboard in a simple way. For example, the code below:
- Use Storyboard or code to create a keyboard component.
import TVOSKeyboard
@IBOutlet weak var keyboardView: KeyboardView!
- Create your own set of characters to enter or use one of the preset ones.
let eng = KeyboardDescription(code: "en", type: .letters, simbols: "abcdefghijklmnopqrstuvwxyz", label: "abc", spaceName: "space")
- Create a configuration object and change the default values if necessary.
let config = KeyboardConfig()
config.keyboardDescriptions = [
eng,
Presets.rus
]
config.topFocusedElement = button
config.isUppercasedOnStart = true
config.allowNumeric = false
config.allowSimbolic = true
config.allowSpaceButton = false
config.allowDeleteButton = false
config.hideOptionalPanel = false
keyboardView.config = config
keyboardView.delegate = self
- Specify as a delegate your ViewController or other object that will be responsible for processing data from the keyboard. To do this the delegate must first be signed under the KeyboardViewProtocol.
public protocol KeyboardViewProtocol: class {
func addSimbol(_ value: String)
func deleteSimbol()
func swipeFromDown()
func deleteLongPress()
func updateString(_ cachedString: String)
func performFocus(element: UIView)
}
- tvOS 13.0+
- Swift 5.0+
If you find an issue, just open a ticket. Pull requests are warmly welcome as well.
TVOSKeyboard is released under the MIT license. See LICENSE for details.