Latest 0.1.9
Homepage https://github.com/chinhnguyen/SwiftMaterialKeyboard
License MIT
Platforms ios 9.3, requires ARC
Dependencies SnapKit, RxSwift, RxCocoa, Material
Frameworks UIKit
Authors

CI Status
Version
License
Platform

Description

In some application, the default keyboard provided by Apple is just not enough, we need more control over the position and also behavior of the on-screen keyboard. For example: we need the Qwerty keyboard to be smaller and always visible that can be tucked to a screen corner instead of taking half of the screen.

Example

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

Requirements

Installation

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

pod 'SwiftMaterialKeyboard'

Create keyboard

To create a custom keyboard, create a new class which inherits from MaterialKeyboard and define the desired number of rows and columns by overriding rowCount and columnCount. Each key will be placed just like an HTML table’s cell with position for row, column and the desired rowSpan or columnSpan.

This is the PinPad which can be found in Example project:

class PinPad: MaterialKeyboard {
    override var rowCount: Int { return 4 }
    override var columnCount: Int { return 4 }
    override func createButtons() -> [KeyboardButton] {
        let prev = KeyboardButton.create(for: FAKMaterialIcons.longArrowTabIcon(withSize: 24), row: 0, column: 3, action: .next)
        prev.transform = CGAffineTransform(rotationAngle: .pi)
        return [
            KeyboardButton.create(for: "1", row: 0, column: 0),
            KeyboardButton.create(for: "2", row: 0, column: 1),
            KeyboardButton.create(for: "3", row: 0, column: 2),
            KeyboardButton.create(for: "4", row: 1, column: 0),
            KeyboardButton.create(for: "5", row: 1, column: 1),
            KeyboardButton.create(for: "6", row: 1, column: 2),
            KeyboardButton.create(for: "7", row: 2, column: 0),
            KeyboardButton.create(for: "8", row: 2, column: 1),
            KeyboardButton.create(for: "9", row: 2, column: 2),
            KeyboardButton.create(for: "0", row: 3, column: 1),
            KeyboardButton.create(for: "CLR", row: 3, column: 0, action: .clear),
            KeyboardButton.create(for: FAKMaterialIcons.arrowLeftIcon(withSize: 24), row: 3, column: 2, action: .backspace),
            prev,
            KeyboardButton.create(for: FAKMaterialIcons.longArrowTabIcon(withSize: 24), row: 1, column: 3, action: .next),
            KeyboardButton.create(for: FAKMaterialIcons.longArrowReturnIcon(withSize: 24), row: 2, column: 3, rowSpan: 2)
        ]
    }
}

And this is how it looks like in a real application:

SwiftMaterialKeyboard

Author

Chinh Nguyen, [email protected]

License

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

Latest podspec

{
    "name": "SwiftMaterialKeyboard",
    "platforms": {
        "ios": "9.3"
    },
    "summary": "Custom keyboard build with CosmicMind/Material and RxSwift",
    "requires_arc": true,
    "version": "0.1.9",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Chinh Nguyen": "[email protected]"
    },
    "homepage": "https://github.com/chinhnguyen/SwiftMaterialKeyboard",
    "source": {
        "git": "https://github.com/chinhnguyen/SwiftMaterialKeyboard.git",
        "tag": "0.1.9"
    },
    "frameworks": "UIKit",
    "dependencies": {
        "SnapKit": [
            "~> 4.0"
        ],
        "RxSwift": [
            "~> 4.0"
        ],
        "RxCocoa": [
            "~> 4.0"
        ],
        "Material": [
            "~> 2.12"
        ]
    },
    "source_files": "SwiftMaterialKeyboard/Classes/**/*",
    "swift_version": "4.0"
}

Pin It on Pinterest

Share This