Skip to content

ziryanov/CCKeyboardControl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CCKeyboardControl

CCKeyboardControl allows you to easily enable interactive dismissing of keyboard. Also it provides a simple way to add keyboard dependent animations.

Installation

CocoaPods is the recommended way to add CCKeyboardControl to your project.

Here's an example podfile that installs CCKeyboardControl.

###Podfile

platform :ios, '6.0'

pod 'CCKeyboardControl'

Usage

Example project included (CCKeyboardControlExample)

Adding pan-to-dismiss (functionality introduced in iMessages)

__weak typeof(self) wself = self;
[self.view addKeyboardPanningWithFrameBasedActionHandler:^(CGRect keyboardFrameInView, CCKeyboardControlState keyboardState) {
    if (keyboardState != CCKeyboardControlStatePanning)
        [wself updateTableViewInsetWithKeyboardFrame:keyboardFrameInView];
} constraintBasedActionHandler:^(CGRect keyboardFrameInView, CCKeyboardControlState keyboardState) {
    wself.bottomPanelBottomConstraint.constant = wself.view.height - keyboardFrameInView.origin.y;
}];

Notes

Keyboard Delay On First Appearance

Standard iOS issue. Use Brandon William's UIResponder category to cache the keyboard before first use.

Automatic Reference Counting (ARC) support

ССKeyboardControl was made with ARC enabled by default.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published