Skip to content

Kofktu/KUIKeyboard

Repository files navigation

KUIKeyboard

Swift CocoaPods Carthage compatible

Keyboard Handler in iOS, It also perfectly works with UIScrollViewKeyboardDismissMode.interactive.

alt tag

Requirements

  • iOS 8.0+
  • Xcode 11.0
  • Swift 5.0 (>= 1.7.0)
  • Swift 4.2 (>= 1.6.0)
  • Swift 4.0 (>= 1.5.0)
  • Swift 3.0 (1.0.0)

Installation

CocoaPods

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

pod "KUIKeyboard"

Usage

KUIKeyboard

import KUIKeyboard

var keyboard = KUIKeyboard()

override func viewDidAppear(_ animated: Bool) {
    super.viewDidAppear(animated)
    keyboard.addObservers()
}

override func viewWillDisappear(_ animated: Bool) {
    super.viewWillDisappear(animated)
    keyboard.removeObservers()
}

KUIKeyboardDelegate

keyboard.delegate = self

...

func keyboard(_ keyboard: KUIKeyboard, changed visibleHeight: CGFloat) {
  // Customize
}

Closure

keyboard.onChangedKeyboardHeight = { (visibleHeight) in
  // Customize        
}

References

Authors

Taeun Kim (kofktu), kofktu@gmail.com

License

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