Latest 0.2.1
License MIT
Platforms ios 10.0, requires ARC
Frameworks UIKit

CI Status


To run the example project, clone the repo, and run pod install from the Example directory first.


Use SuxiNumberInputView like below:

let textFieldInputView = SuxiNumberInputView().bindTo(textField: textField)
// This is optional
textFieldInputView?.delegate = self

let textViewInputView = SuxiNumberInputView().bindTo(textView: textView)
// This is optional
textViewInputView?.delegate = self

And your UITextField or UITextView should work as usual.

Notice that SuxiNumberInputView will automatically change keyboard type to number pad when binding.

SuxiNumberInputView does very simple check to avoid incorrect number format. Currently only support floating number format.

SuxiNumberInputViewDelegate provides information to you to know what button is tapped:

func suxiNumberInputView(_ inputView: SuxiNumberInputView, pressedKey keyCode: SuxiNumberKeyCode)

The SuxiNumberKeyCode enum

enum SuxiNumberKeyCode {
    case one
    case two
    case three
    case four
    case five
    case six
    case seven
    case eight
    case nine
    case zero
    case dot
    case delete
    case done

You can use keyCode.value to obtain the raw value of the keycode, delete and done keycode return empty string.

Screen Shot

Screen Shot


iOS 10.0+


SuxiNumberInputView is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod "SuxiNumberInputView"




SuxiNumberInputView is available under the MIT license. See the LICENSE file for more info.

Latest podspec

    "name": "SuxiNumberInputView",
    "version": "0.2.1",
    "summary": "A simple custom number pad input view with a "Done" button.",
    "requires_arc": true,
    "description": "SuxiNumberInputView is a simple custom input view for UITextField and UITextView when you want to use number pad keyboard with a "Done" button.",
    "homepage": "",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    "authors": {
        "simon.lin": "[email protected]"
    "source": {
        "git": "",
        "tag": "0.2.1"
    "platforms": {
        "ios": "10.0"
    "swift_version": "4.2",
    "source_files": "SuxiNumberInputView/**/*.{swift}",
    "resources": "SuxiNumberInputView/**/*.{xib,png}",
    "frameworks": "UIKit"

Pin It on Pinterest

Share This