KeyboardWrapper 4.1.0

KeyboardWrapper 4.1.0

TestsTested
LangLanguage SwiftSwift
License MIT
ReleasedLast Release Sep 2018
SPMSupports SPM

Maintained by Aleksey Kuznetsov.



  • By
  • Aleksey Kuznetsov

KeyboardWrapper

Build Status Cocoapod

A safe wrapper for UIKeyboard notifications written in Swift.

Demo

Usage

  • Import module
import KeyboardWrapper
  • Create KeyboardWrapper instance
keyboardWrapper = KeyboardWrapper(delegate: self)
  • Implement 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()
    }
}

Requirements

  • iOS 8.0 or higher
  • Xcode 9.0 (swift 4.0) or higher

For older versions of xcode and swift please use 3.0.1 version of the lib.

Changes

Take a look at change log.

Installation

CocoaPods

KeyboardWrapper is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'KeyboardWrapper', '~> 4.1'

Manual

Just drop the KeyboardWrapper.swift file into your project. That's it!

License

KeyboardWrapper is available under the MIT license. See the LICENSE file for more info.