To run the example project, clone the repo, and run
pod install from the Example directory first.
NYSKeyboardHelper is available through CocoaPods. To install it, simply add the following line to your Podfile:
NYSKeyboardHelper is available through Carthage. To install it, simply add the following line to your Cartfile:
Simply pin a constraint to the bottom of your view and the scrollview that wraps your textinput. Override the NSLayoutconstraint as 'NYSKeyboardHelper'. And that's it. It should automatically shrink your scrollview to not go under your keyboard.
Add some 'extra indent' in the properties of the constraint to have a bit of margin between your containerview and the view.
let keyboardConstraint = NYSKeyboardHelper(item: self.view, attribute: .bottom, relatedBy: .equal, toItem: scrollView, attribute: .bottom, multiplier: 1.0, constant: 0.0) keyboardConstraint.extraIndent = 10.0 self.view.addConstraint(keyboardConstraint)
set the 'extraIndent' property to have more margin between your containerview and the view.
NYSKeyboardHelper is available under the MIT license. See the LICENSE file for more info.