- Return button
- Optional buttons (plus, dot)
- Long press support for delete key
- Custom styles
- Improve InputControlller (ask delegate aboult shouldChangeCharactersInRange)
- System slyles (light, dark) + vibrancy
- iOS 11 PhonePad keyboard style
- Appearance from
UIInputTraits.keyboardAppearance
let textField = UITextField(frame: .zero)
...
textField.inputView = NumberPad(optionalKey: .dot)
.with(styleFrom: textField)
.withStandardInputController()You can provide Your own keyboard behaviour by implementing InputConroller protocol
// custom conroller for keyboard events
class MyInputController: InputController {
...
}
let pad = NumberPad()
.with(inputController: MyInputController())Or use closures directly:
let pad = NumberPad(optionalKey: .plus)
.onTextInput { (symbol) in
// proccess symbol input
}.onReturn {
// proccess action button
}.onBackspace {
// proccess backspace button
}Default implementation of KeyboardStyle represents default style.
// define your own custom style
struct MyCustomStyle: KeyboardStyle {
...
}
let pad = NumberPad(optionalKey: .dot)
.with(style: MyCustomStyle())- Swift 3.2+
- xCode 9+
- iOS 8.0+
Carthage is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.
You can install Carthage with Homebrew using the following command:
$ brew update
$ brew install carthageTo integrate NumberPad into your Xcode project using Carthage, specify it in your Cartfile:
github "OlegKetrar/NumberPad"
Run carthage update to build the framework and drag the built NumberPad.framework into your Xcode project.
NumberPad is released under the MIT license. See LICENSE for details.