Latest 0.1.8
Homepage https://github.com/nathan-fiscaletti/KeyboardLockiOS
License MIT
Platforms ios 11.0
Authors

Preview

CI Status
Version
License
Platform

Example

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

KeyboardLock(
    withView: containerView,
    andLockType: .BottomConstraint
).lock()

Lock Types

Lock Type Description Constraint Search Criteria
.BottomConstraint The bottom constraint will be moved up based on the height of the keyboard at the end of it’s animation cycle. superView.constraints.firstAttribute == .bottom && superview.constraints.relation == .equal
.HeightConstraint The height of the constraint will be shortened based on the height of the keyboard at the end of it’s animation cycle. view.constraints.firstAttribute == .height && view.constraints.relation == .equal
.FrameOrigin The Y origin point of the views frame will be moved up based on the height of the keyboard at the end of it’s animation cycle. None

Other Notes

  1. When using .BottomConstraint or .HeightConstraint, you can either pass the constraint you wish to update manually using andConstraint: in the constructor, or you can leave it blank and the system will attempt to find the constraint itself. If it cannot find the proper constraint, a warning message will be sent through NSLog.
  2. You can unlock a view from the keyboard using the .unlock() member function of the associated KeyboardLock instance.

Installation

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

pod 'KeyboardLock'

Author

nathan-fiscaletti, [email protected]

License

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

Latest podspec

{
    "name": "KeyboardLock",
    "version": "0.1.8",
    "summary": "An iOS module for locking a view to the keyboard",
    "swift_version": "4.2",
    "description": "Lock any view to the keyboard. Works best when you have a single container view with everything else inside of it.",
    "homepage": "https://github.com/nathan-fiscaletti/KeyboardLockiOS",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "nathan-fiscaletti": "[email protected]"
    },
    "source": {
        "git": "https://github.com/nathan-fiscaletti/KeyboardLockiOS.git",
        "tag": "0.1.8"
    },
    "platforms": {
        "ios": "11.0"
    },
    "source_files": "KeyboardLock/Classes/**/*"
}

Pin It on Pinterest

Share This