https://github.com/haaakon/SingleLineKeyboardResize
With this non-intrusive UIViewController extension, only a single line of code will make your scrollView auto resize when the keyboard appears
https://github.com/haaakon/SingleLineKeyboardResize
Last synced: 2 months ago
JSON representation
With this non-intrusive UIViewController extension, only a single line of code will make your scrollView auto resize when the keyboard appears
- Host: GitHub
- URL: https://github.com/haaakon/SingleLineKeyboardResize
- Owner: haaakon
- License: mit
- Created: 2015-02-20T20:57:34.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2019-03-22T10:17:17.000Z (over 6 years ago)
- Last Synced: 2025-04-19T01:32:32.776Z (3 months ago)
- Language: Swift
- Homepage:
- Size: 3.85 MB
- Stars: 87
- Watchers: 5
- Forks: 23
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SingleLineKeyboardResize
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.[](https://travis-ci.org/haaakon/SingleLineKeyboardResize)
[](http://cocoadocs.org/docsets/SingleLineKeyboardResize)
[](http://cocoadocs.org/docsets/SingleLineKeyboardResize)
[](http://cocoadocs.org/docsets/SingleLineKeyboardResize)Demo
=====
#### UIScrollView

#### UITableView
USAGE
=====
For a scrollView from nib or storyboard
```swift
@IBOutlet weak var scrollView : UIScrollView!
override func viewDidLoad() {
super.viewDidLoad()
setupKeyboardNotifcationListenerForScrollView(scrollView)
}
```Just as simple if you want to use it with a tableView
```Swift
@IBOutlet weak var tableView : UITableView!
override func viewDidLoad() {
super.viewDidLoad()
setupKeyboardNotifcationListenerForScrollView(tableView)
}
```To remove observers for example in deinit
```Swift
deinit {
removeKeyboardNotificationListeners()
}
```## Installation
### CocoaPods
SingleLineKeyboardResize is available through [CocoaPods](http://cocoapods.org). 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.
- [SingleLineShakeAnimation](https://github.com/haaakon/SingleLineShakeAnimation)
- [SingleLineKeyboardResize](https://github.com/haaakon/SingleLineKeyboardResize)