Skip to content

bartekhugo/BHTKeyboardAnimationBlocks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BHTKeyboardAnimationBlocks

UIViewController category making life easier when working with animations on keybard appearing/disappearing. Provides a simple block based API to set animations to be performed on each of UIKeyboardNotifications.

Category registers only for those notifications for which there are any blocks set. Registering for notifications happens on viewWillAppear: method call and unregistering on viewDidDisappear: method call.

If view controller is already visible when setting blocks It will automatically register for those notification or unregister from them when assigning nil.

Installation

  • Add to your podfile:

    pod 'UIViewController+BHTKeyboardAnimationBlocks', '~> 0.0.2'

Usage

- (void)setupKeyboardAnimations
{
    __weak typeof(self) wself = self;
    
    [self setKeyboardWillShowAnimationBlock:^(CGRect keyboardFrame) {
        // block to be performed during keybord appearing
    }];
    
    [self setKeyboardWillHideAnimationBlock:^(CGRect keyboardFrame) {
        // block to be performed during keybord disappearing
    }];
    
    [self setKeyboardDidShowActionBlock:^(CGRect keyboardFrame){
        // block to be performed when keyboard did appear
    }];
    
    [self setKeyboardDidHideActionBlock:^(CGRect keyboardFrame){
        // block to be performed when keyboard did hide
    }];
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published