TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | MIT |
ReleasedLast Release | Sep 2015 |
Maintained by Candyan.
ANKeyboardObserverManager make your keyboard observe easier and more flexible. I
To install ANKeyboardObserverManager either:
pod 'ANKeyboardObserverManager'
Use [ANKeyboardObserverManager sharedManager] directly or alloc/init ANKeyboardObserverManager instance in the class you want to use it.
Then add the observer:
- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
[[ANKeyboardObserverManager sharedManager] addKeyboardObserver:self
withkeyboardWillShowBlock:^(CGRect keyboardEndFrame, NSTimeInterval animateDuration, NSDictionary *info) {
your code
}
keyboardWillHideBlock:^(CGRect keyboardEndFrame, NSTimeInterval animateDuration, NSDictionary *info) {
your code
}];
}
When you do not want to observe the keyboard, remove the observer:
- (void)viewWillDisappear:(BOOL)animated
{
[super viewWillDisappear:animated];
[[ANKeyboardObserverManager sharedManager] removeKeyboardObserver:self];
}