Skip to content

It can easy watch the Keyboard status changing, example the keyboard slide up, slide down, change inputs status bar, disappear ... etc.

License

Notifications You must be signed in to change notification settings

Kalvar/ios-KRWatchKeyboard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Screen Shot

KRWatchKeyboard

KRWatchKeyboard

Supports

KRWatchKeyboard supports ARC ( Automatic Reference Counting ).

How To Get Started

KRWatchKeyboard which you can use it to watch the Keyboard events if it changing anything. For example, If we need to control a UITextView slide up or slide down when the keyboard appear or disappear by itself, the sample code like the under.

- (void)viewDidLoad
{
    [super viewDidLoad];
    _krWatchKeyboard = [[KRWatchKeyboard alloc] initWithDelegate:self];
    [self._krWatchKeyboard startWatch];
    //When you leaved here, please remember to stop the watching event will be safe.
    //[self._krWatchKeyboard stopWatch];
}

#pragma KRWatchKeyboardDelegate
-(void)krWatchKeyboardWillShow:(CGRect)_foundKeyboardFrame
{
    //CGFloat _keyboardBaseHeight = 216.0f;
    CGFloat _foundHeight = _foundKeyboardFrame.size.height;
    [UIView animateWithDuration:0.25f delay:0.0f options:UIViewAnimationOptionBeginFromCurrentState animations:^{
        CGRect _frame   = self.view.frame;
        _frame.origin.y = -( _foundHeight );
        [self.view setFrame:_frame];
    } completion:^(BOOL finished) {
        //...
    }];
}

-(void)krWatchKeyboardWillHide
{
    //NSLog(@"krWatchKeyboardWillHide");
}

Version

KRWatchKeyboard now is V1.0 beta.

License

KRWatchKeyboard is available under the MIT license ( or Whatever you wanna do ). See the LICENSE file for more info.

About

It can easy watch the Keyboard status changing, example the keyboard slide up, slide down, change inputs status bar, disappear ... etc.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages