KeyboardListener
防止键盘覆盖 UITextField/UITextView,包含 Swift 和 Objective-C API。
需求
- iOS 9.0+
- Swift 4.2+
用法
- Swift
// add
self.view.kl.addKeyboardListener()
- Objective-C
// add
[self.view lc_addKeyboardListener];
安装
CocoaPods
要使用 CocoaPods 在您的 Xcode 项目中集成 KeyboardListener,请在您的 Podfile
文件中指定它。
- Swift
pod 'KeyboardListener'
- Objective-C
pod 'LCKeyboardListener'
手动
- Swift
- 下载 KeyboardListener 目录中的所有内容;
- 将 KeyboardListener 中的源文件拖放到您的项目中。
- Objective-C
- 下载 KeyboardListener 目录中的所有内容;
- 将 LCKeyboardListener 中的源文件拖放到您的项目中;
- 导入
UIView+LCKeyboardListener.h
。
许可证
KeyboardListener 在 MIT 许可证下提供。有关详细信息,请参阅 LICENSE 文件。