AutomaticKeyboard
AutomaticKeyboard是当键盘可见时管理视图的辅助工具。
安装
CocoaPods
要使用CocoaPods安装AutomaticKeyboard,请将以下行添加到您的Podfile
。
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '9.0'
use_frameworks!
pod 'AutomaticKeyboard'
Carthage
Carthage是一个去中心化的依赖管理器,它可以构建您的依赖并提供二进制框架。
您可以使用以下命令通过 Homebrew 安装 Carthage
$ brew update
$ brew install carthage
要在使用 Carthage 的 Xcode 项目中集成 AutomaticKeyboard,请在您的 Cartfile
中指定它
github 'Digipolitan/automatic-keyboard' ~> 1.0
运行carthage update
构建框架,然后将构建的AutomaticKeyboard.framework
拖到您的 Xcode 项目中。
基础知识
在您的 viewWillAppear 方法中设置键盘属性
override open func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
if let kv = self.keyboardView {
self.keyboard = Keyboard(view: kv, options: self.keyboardOptions)
}
}
以及您的 viewDidDisappear
override open func viewDidDisappear(_ animated: Bool) {
super.viewDidDisappear(animated)
self.keyboard = nil
}
完成所有这些步骤后,您需要设置 .xib 文件以接受 AutomaticKeyboard
查看 AutomaticKeyboardSample-iOS
以获取完整的示例。
贡献
有关更多详细信息,请参阅 CONTRIBUTING.md!
本项目遵循贡献者公约行为准则。通过参与,您应遵守此准则。请向[email protected] 报告不可接受的行为。
许可
AutomaticKeyboard 在 BSD 3-条款许可 下授权。