NYSKeyboardHelper 0.3.0

NYSKeyboardHelper 0.3.0

Maintained by Matthias Nys, Dwayne Coussement.



  • By
  • matthiasnys

NYSKeyboardHelper

CI Status Version License Platform

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

Installation

Cocoapods

NYSKeyboardHelper is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'NYSKeyboardHelper'

Carthage

NYSKeyboardHelper is available through Carthage. To install it, simply add the following line to your Cartfile:

github "matthiasnys/NYSKeyboardHelper"

Use

Storyboards

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.

Code

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.

Author

matthiasnys, [email protected]

License

NYSKeyboardHelper is available under the MIT license. See the LICENSE file for more info.