用于消息应用的自增长文本输入栏。使用 Swift 编写。
ALTextInputBar 旨在解决人们在构建消息应用时遇到的一些问题。
此项目需要在 Xcode 8.0 上运行,并用 swift 3.0 编译
ALTextInputBar 在 CocoaPods 上可用。将以下内容添加到 Podfile
pod 'ALTextInputBar'
这是附加输入栏到键盘所需的最小配置
class ViewController: UIViewController {
let textInputBar = ALTextInputBar()
// The magic sauce
// This is how we attach the input bar to the keyboard
override var inputAccessoryView: UIView? {
get {
return textInputBar
}
}
// Another ingredient in the magic sauce
override var canBecomeFirstResponder: Bool {
return true
}
}
ALTextInputBar 基于 MIT 许可协议。有关更多信息,请参阅 LICENSE 文件。