https://github.com/onmotion/asviewcontroller
iOS ViewController with auto scroll to active textField when keyboard is showing
https://github.com/onmotion/asviewcontroller
ios keyboard-scroll-adjust scroll swift textfield-scroll
Last synced: about 1 year ago
JSON representation
iOS ViewController with auto scroll to active textField when keyboard is showing
- Host: GitHub
- URL: https://github.com/onmotion/asviewcontroller
- Owner: onmotion
- License: mit
- Created: 2018-02-06T09:43:25.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-02-21T13:45:11.000Z (over 8 years ago)
- Last Synced: 2024-03-15T14:22:20.423Z (about 2 years ago)
- Topics: ios, keyboard-scroll-adjust, scroll, swift, textfield-scroll
- Language: Swift
- Size: 9.04 MB
- Stars: 1
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ASViewController
[](http://cocoapods.org/pods/ASViewController)
[](http://cocoapods.org/pods/ASViewController)
[](http://cocoapods.org/pods/ASViewController)
## Example

## Requirements
iOS 8.0+
Swift 4.0
## Installation
ASViewController is available through [CocoaPods](http://cocoapods.org). To install
it, simply add the following line to your Podfile:
```ruby
pod 'ASViewController'
```
* Add import **ASViewController** to your **ViewController**
* Inherit your **ViewController** from **ASViewController** instead **UIASViewController**
* then wrap your view contains text fields into **UIScrollView**, add ```@IBOutlet``` and bind it to scrollableArea as so:

* Setup AutoLayout like so:


## Settings
Also you can set up offset to text field (default = 20)
```
ASViewController.offset = 10
```
```
ASViewController.dismissKeyboardWhenTapAnywhere = true // (default = false) keyboard will be hidden when tapped anywhere outside textfield
```
## Author
Alexandr Kozhevnikov, onmotion1@gmail.com
## License
ASViewController is available under the MIT license. See the LICENSE file for more info.