Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: 3 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 (about 10 years ago)
- Default Branch: master
- Last Pushed: 2019-03-22T10:17:17.000Z (almost 6 years ago)
- Last Synced: 2024-09-25T14:06:11.033Z (5 months ago)
- Language: Swift
- Homepage:
- Size: 3.85 MB
- Stars: 86
- Watchers: 6
- 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)