Simple, movable and powerful toolbar for UITextField and UITextView.
Simple, movable and powerful toolbar for UITextField and UITextView.
Sample GIF | Capture |
---|---|
UITextField
and UITextView
. (mix ok!!)class ViewController: UIViewController {
@IBOutlet private weak var emailTextField: UITextField!
@IBOutlet private weak var passwordTextField: UITextField!
@IBOutlet private weak var profileTextView: UITextView!
}
self.toolbar = FormToolbar(inputs: [emailTextField, passwordTextField, profileTextView])
func textFieldDidBeginEditing(_ textField: UITextField) {
toolbar.updater()
}
NOTE: There is demo project!!
toolbar.direction = .leftRight
toolbar.direction = .upDown
Left-Right
Up-Down
toolbar.doneButtonTitle = "👇"
toolbar.backButtonTintColor = .red
toolbar.forwardButtonTintColor = .green
toolbar.doneButtonTintColor = .purple
// or set all together
toolbar.setButtonsTintColor(.red)
toolbar.currentInput
toolbar.previousInput
toolbar.nextInput
if let activeTextField = toolbar.currentInput as? UITextField {
// ...
}
let newInputs: [FormInput] = [emailTextField, passwordTextField]
toolbar.set(inputs: newInputs)
func textFieldShouldReturn(_ textField: UITextField) -> Bool {
toolbar.goForward()
return true
}
github "sgr-ksmt/FormToolbar" ~> 1.0
carthage update
FormToolbar is available through CocoaPods. To install
it, simply add the following line to your Podfile:
pod 'FormToolbar', '~> 1.0'
and run pod install
Download all *.swift
files and put your project.
Change log is here.
FormToolbar is under MIT license. See the LICENSE file for more info.