Latest 0.1.0
Homepage https://github.com/zummenix/KeyboardNotificationsObserver
License MIT
Platforms ios 9.0
Frameworks UIKit
Authors

Build Status
Cocoapod

An observer for UIKeyboard notifications that provides a safe and convenient interface.

Demo

Usage

  • Import module

    import KeyboardNotificationsObserver
  • Create KeyboardNotificationsObserver instance as a property (for example on a view controller)

    private let keyboardObserver = KeyboardNotificationsObserver()
  • Implement necessary callbacks
    override func viewDidLoad() {
    super.viewDidLoad()
    keyboardObserver.onWillShow = { [weak self] info in
        // Change a view according to keyboard size.
    }
    }

All six UIKeyboard notifications are implemented. You can use the following callbacks:
onWillShow, onDidShow, onWillHide, onDidHide, onWillChangeFrame, onDidChangeFrame

Requirements

  • iOS 9.0 or higher
  • Xcode 10 (swift 5.0) or higher

Changes

Take a look at change log.

Installation

CocoaPods

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

pod 'KeyboardNotificationsObserver'

Manual

Just drop the KeyboardNotificationsObserver.swift file into your project. That’s it!

License

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

Latest podspec

{
    "name": "KeyboardNotificationsObserver",
    "version": "0.1.0",
    "summary": "An observer of `UIKeyboard` notifications.",
    "description": "An observer for `UIKeyboard` notifications that provides a safe and convenient interface.",
    "homepage": "https://github.com/zummenix/KeyboardNotificationsObserver",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Aleksey Kuznetsov": "[email protected]"
    },
    "source": {
        "git": "https://github.com/zummenix/KeyboardNotificationsObserver.git",
        "tag": "0.1.0"
    },
    "platforms": {
        "ios": "9.0"
    },
    "swift_version": "5.0",
    "source_files": "KeyboardNotificationsObserver/Classes/**/*",
    "frameworks": "UIKit"
}

Pin It on Pinterest

Share This