Latest 1.0.3
Homepage https://github.com/LucasBest/KeyboardMaster
License MIT
Platforms ios 8.0
Frameworks UIKit
Authors

Version
License
Platform

KeyboardMaster is a simple Swift extension on UIScrollView that allows you to easily and automatically manage the keyboard in iOS. Simply call UIScrollView.registerForKeyboardEvents() and the extension will do the rest of the work for you.

The extension converts the frame of the keyboard into the coordinate space of the scroll view, then calculates the overlap. Using the overlap rect the extension then sets self.contentInset accordingly.

The extension uses NotificationCenter to listen for keyboard events so it is important to call UIScrollView.deregisterFromKeyboardEvents() when you are no longer interested in monitoring keyboard activity.

You can also optionally pass the flag automaticallyAdjustContentOffset:true to the .registerForKeyboardEvents() function to have the keyboard automatically scroll up when the keyboard shows.

Example

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

Requirements

KeyboardMaster is built with Swift 4.2 and set to run on devices targeting iOS 8 and later.

Installation

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

pod 'KeyboardMaster'

Author

Lucas Best, [email protected]

License

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

Latest podspec

{
    "name": "KeyboardMaster",
    "version": "1.0.3",
    "summary": "KeyboardMaster is a UIScollView extension intended to make it easier to manage the iOS keyboard.",
    "description": "KeyboardMaster is a simple Swift extension on UIScrollView that allows you to easily and automatically manage the keyboard in iOS. Simply call UIScrollView.registerForKeyboardEvents() and the extension will do the rest of the work for you.",
    "homepage": "https://github.com/LucasBest/KeyboardMaster",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Lucas Best": "[email protected]"
    },
    "source": {
        "git": "https://github.com/LucasBest/KeyboardMaster.git",
        "tag": "1.0.3"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "KeyboardMaster/Classes/**/*",
    "frameworks": "UIKit"
}

Pin It on Pinterest

Share This