KUIKeyboard icon indicating copy to clipboard operation
KUIKeyboard copied to clipboard

Keyboard Handler in iOS

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

  • RxKeyboard (https://github.com/RxSwiftCommunity/RxKeyboard)

Authors

Taeun Kim (kofktu), [email protected]

License

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