To run the example project, clone the repo, and run pod install from the Example directory first.
- iOS 9.0+
ScrollingFormHelper is available through Swift Package Manager, simply add it as a new dependency.
ScrollingFormHelper is also available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'ScrollingFormHelper'Initialize an instance of ScrollingFormHelper on the view controller's viewDidLoad method:
override func viewDidLoad() {
super.viewDidLoad()
scrollingFormHelper = ScrollingFormHelper(scrollView: scrollView, shouldDismissKeyboardOnTap: true)
textField.delegate = self
}Then set the currentTextField attribute on textFieldDidBeginEditing (You need to set the delegate for each one of your text fields):
extension ViewController: UITextFieldDelegate {
func textFieldDidBeginEditing(_ textField: UITextField) {
scrollingFormHelper?.currentView = textField
}
}You can also refer to the example app on this repository.
lautarodelosheros, [email protected]
ScrollingFormHelper is available under the MIT license. See the LICENSE file for more info.