Latest 0.1.3
Homepage https://github.com/haaakon/SingleLineKeyboardResize
License MIT
Platforms ios 8.0, requires ARC
Frameworks UIKit
Authors

With this non-intrusive UIViewController extension, only a single line of code will make your scrollView auto resize when the keyboard appears. It literally cannot get easier than this, and you don’t even need to subclass anything.

CI Status
Version
License
Platform

Demo

UIScrollView

Resize Example

UITableView

Resize Example

USAGE

For a scrollView from nib or storyboard

@IBOutlet weak var scrollView : UIScrollView!

    override func viewDidLoad() {
        super.viewDidLoad()
        setupKeyboardNotifcationListenerForScrollView(scrollView)
    }

Just as simple if you want to use it with a tableView

@IBOutlet weak var tableView : UITableView!

    override func viewDidLoad() {
        super.viewDidLoad()
        setupKeyboardNotifcationListenerForScrollView(tableView)

    }

To remove observers for example in deinit

deinit {
        removeKeyboardNotificationListeners()
    }

Installation

CocoaPods

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

pod "SingleLineKeyboardResize"

Without CocoaPods:

It’s only one file you need, ‘UIViewController+Keyboard.swift’, copy it into your project, and you are good to go.

Author

Håkon Bogen, [email protected]

License

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

Single Line APIs

Really good APIs should not need more than a single line of code to work and be as non intrusive as possible. This library is a part of my ongoing effort to build single line libraries for iOS. Check out the other ones on the list as well.

Latest podspec

{
    "name": "SingleLineKeyboardResize",
    "version": "0.1.3",
    "summary": "A single line of code will make your UITableView or any UIScrollView auto resize when the keyboard appears",
    "description": "With this non-intrusive UIViewController extension, only a single line of code will make your scrollView auto resize when the keyboard appears. It literally cannot get easier than this, and you don't even need to subclass anything.",
    "homepage": "https://github.com/haaakon/SingleLineKeyboardResize",
    "license": "MIT",
    "authors": {
        "Hakon Bogen": "[email protected]"
    },
    "source": {
        "git": "https://github.com/haaakon/SingleLineKeyboardResize.git",
        "tag": "0.1.3"
    },
    "social_media_url": "https://twitter.com/_haaakon",
    "platforms": {
        "ios": "8.0"
    },
    "requires_arc": true,
    "source_files": "UIViewController+Keyboard.swift",
    "frameworks": "UIKit"
}

Pin It on Pinterest

Share This