Skip to content

carlSQ/KeyboardManager

Repository files navigation

KeyboardManager

CI Status Version License Platform

Example

To run the example project, clone the repo.

Installation

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

pod "KeyboardManager"

Usage

KeyboardManager in UIViewCintroller

You should call in viewWillAppear method

[self kba_keyboardAnimationWithWillStart:^(CGRect startKeyboardRect, CGRect keyboardRect, NSTimeInterval duration, BOOL willShow) {

}                              animation:^(CGRect startKeyboardRect, CGRect keyboardRect, NSTimeInterval duration, BOOL isShowing) {

  if (isShowing) {
    _inputBackgroundView.frame = CGRectMake(0, keyboardRect.origin.y-64, [UIScreen mainScreen].bounds.size.width, 64);
  } else {
    _inputBackgroundView.frame = CGRectMake(0, [UIScreen mainScreen].bounds.size.height, [UIScreen mainScreen].bounds.size.width, 64);
  }

}
animationComplete:^(BOOL finished) {

}];

KeyboardManager in UIView

You should call before UIViewCintroller viewWillAppear method

[view kba_keyboardAnimationWithWillStart:nil
                               animation:^(CGRect startKeyboardRect, CGRect endKeyboardRect, NSTimeInterval duration, BOOL isShowing) {
                                   ...
                                }
                       animationComplete:nil];

License

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

About

Keyboard Animation Manager

Resources

License

Stars

Watchers

Forks

Packages

No packages published