What is Customkeyboard?
Customkeyboard is a simple and fast framework for custom digital keyboards. There's always a keyboard for you.
Screencast from our Demo
Requirements
- iOS 11.2
- Xcode 9.2
- Swift 4.0.2+
Installation
CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:
$ gem install cocoapods
Just add the Customkeyboard
folder to your project.
or use CocoaPods
with Podfile:
pod 'Customkeyboard'
Swift 4.0.3:
platform :ios, '11.2'
target '<Your Target Name>' do
use_frameworks!
pod 'Customkeyboard'
end
Then, run the following command:
$ pod install
Revision
- Add button sound
- Add long press to delete
Example:
import UIKit
import Customkeyboard
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
view.backgroundColor = UIColor.gray
example()
}
/// 例子
private func example() {
/// 文本框
let textField = UITextField(frame: CGRect(x: 100, y: 120, width: 200, height: 35))
textField.backgroundColor = UIColor.white
view.addSubview(textField)
/* -- CustomKeyboard --- */
let keyboard = CustomKeyboard(view, field: textField)
keyboard.style = .number
keyboard.whetherHighlight = true
keyboard.frame.size.height = 300
keyboard.customDoneButton(title: "确定", titleColor: .white, theme: lightBlue, target: self, callback: nil)
textField.becomeFirstResponder()
}
}