Skip to content
This repository has been archived by the owner on Oct 20, 2020. It is now read-only.

zummenix/KeyboardWrapper

Repository files navigation

KeyboardWrapper

Deprecated!!!

This project is deprecated in favor of the new one https://github.com/zummenix/KeyboardNotificationsObserver

The new project has more modern and convenient interface, fixes some pitfalls of the current project and, did I mention, it has better interface ;). I hope you like it.


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.

About

A safe wrapper for UIKeyboard notifications.

Resources

License

Stars

Watchers

Forks

Packages

No packages published