KeyboardWrapper 4.1.0

KeyboardWrapper 4.1.0

测试已测试
语言语言 SwiftSwift
许可 MIT
发布最后发布2018年9月
SPM支持 SPM

Aleksey Kuznetsov 维护。



  • Aleksey Kuznetsov

KeyboardWrapper

Build Status Cocoapod

Swift 编写的 UIKeyboard 通知的安全包装。

Demo

用法

  • 导入模块
import KeyboardWrapper
  • 创建 KeyboardWrapper 实例
keyboardWrapper = KeyboardWrapper(delegate: self)
  • 实现 KeyboardWrapperDelegate
extension ViewController: KeyboardWrapperDelegate {
    func keyboardWrapper(_ wrapper: KeyboardWrapper, didChangeKeyboardInfo info: KeyboardInfo) {

        if info.state == .willShow || info.state == .visible {
            bottomConstraint.constant = info.endFrame.size.height
        } else {
            bottomConstraint.constant = 0.0
        }

        view.layoutIfNeeded()
    }
}

要求

  • iOS 8.0 或更高版本
  • Xcode 9.0 (swift 4.0) 或更高版本

对于旧版本的 Xcode 和 Swift,请使用 3.0.1 版本的库。

变更

请查看 变更日志

安装

CocoaPods

KeyboardWrapper可以通过CocoaPods使用。要安装它,只需将以下行添加到您的Podfile中:

pod 'KeyboardWrapper', '~> 4.1'

手册

只需将KeyboardWrapper.swift文件放入您的项目中,这样就完成了!

许可

KeyboardWrapper遵循MIT许可协议。更多信息请参阅LICENSE文件。