Customkeyboard is a simple and fast framework for custom digital keyboards. There's always a keyboard for you.
- iOS 11.2
- Xcode 9.2
- Swift 4.0.2+
CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:
$ gem install cocoapods
Just add the DigitalKeyboard
folder to your project.
or use CocoaPods
with Podfile:
pod 'Customkeyboard'
Swift 4.0.2:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '11.2'
use_frameworks!
target '<Your Target Name>' do
pod 'Customkeyboard', '~> 0.1.0'
end
Then, run the following command:
$ pod install
import UIKit
import Customkeyboard
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
view.backgroundColor = UIColor.black
let textfeild = UITextField(frame: CGRect(x: 50, y: 50, width: 100, height: 30))
textfeild.backgroundColor = UIColor.white
view.addSubview(textfeild)
let keyboard = DigitalKeyboard(view)
keyboard.style = .number
keyboard.customDoneButton(title: "确定", titleColor: .white, theme: .orange, target: self, callback: nil)
textfeild.inputView = keyboard
textfeild.becomeFirstResponder()
}
}