答案 0 :(得分:0)
我正在创建一个库来创建自定义键盘 - https://github.com/Brimizer/Slidden
目标是让您轻松使用基本键盘。 就像创建几个键并将它们添加到键盘一样简单。
func setupKeys() {
let helloKey = KeyboardKeyView(type: .Character, keyCap: "Hello", outputText: "Hello")
helloKey.textColor = UIColor.whiteColor()
helloKey.color = UIColor.blueColor()
self.keyboardView.addKey(helloKey, row: 0)
let worldKey = KeyboardKeyView(type: .Character, keyCap: "World", outputText: "World")
worldKey.textColor = UIColor.whiteColor()
worldKey.color = UIColor.redColor()
self.keyboardView.addKey(worldKey, row: 0)
}