CCKeyboardControl allows you to easily enable interactive dismissing of keyboard. Also it provides a simple way to add keyboard dependent animations.
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'
Example project included (CCKeyboardControlExample)
__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;
}];
Standard iOS issue. Use Brandon William's UIResponder category to cache the keyboard before first use.
ССKeyboardControl was made with ARC enabled by default.