Skip to content

Latest commit

 

History

History
44 lines (30 loc) · 1.02 KB

File metadata and controls

44 lines (30 loc) · 1.02 KB

CactusKeyboard

CactusKeyboard is a usless helper for keyboard observing. It uses system notifications and have UIViewController extension functions, so you don't need to restructure your project, just use extension functions.

Usage

Import CactusKeyboard in the file:

import CactusKeyboard

Then add observer to yout ViewController:

    override func viewDidLoad() {
        super.viewDidLoad()
        
        addKeyboardObserver { [weak self] (visible, height) in
            guard let `self` = self else { return }
            print("\(self) keyboard visible: \(visible) height: \(height)")
        }
    }
    
    deinit {
        removeKeyboardObserver()
    }

Installation

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

pod 'CactusKeyboard'

Author

MaksimVialykh, maxim.vialykh@cactussoft.biz

License

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