iOS 8.0+ Swift 4.0
ASViewController is available through CocoaPods. To install it, simply add the following line to your Podfile:
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:
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
Alexandr Kozhevnikov, [email protected]
ASViewController is available under the MIT license. See the LICENSE file for more info.