FormToolbar 1.1

FormToolbar 1.1

TestsTested
LangLanguage SwiftSwift
License MIT
ReleasedLast Release Dec 2017
SPMSupports SPM

Maintained by sgr-ksmt.



  • By
  • Suguru Kishimoto

Simple, movable and powerful toolbar for UITextField and UITextView.

Sample GIF Capture
gif gif

Feature

  • Easy to use. (Just add inputs to toolbar).
  • available to use UITextField and UITextView. (mix ok!!)

Usage

Getting Started

  • ViewController has two text fields and one text view.
class ViewController: UIViewController {
    @IBOutlet private weak var emailTextField: UITextField!
    @IBOutlet private weak var passwordTextField: UITextField!
    @IBOutlet private weak var profileTextView: UITextView!
}
  • Create Toolbar (and attach toolbar to textfield's inputAccessoryView)
    self.toolbar = FormToolbar(inputs: [emailTextField, passwordTextField, profileTextView])
  • Call update() on UITextField's delegate method. (or UItextView's delegate method.)
func textFieldDidBeginEditing(_ textField: UITextField) {
    toolbar.updater()
}
  • "Is that all?" - Yeah, that is all. 👍

NOTE: There is demo project!!

Advanced

  • Back/Forward button type
toolbar.direction = .leftRight
toolbar.direction = .upDown

Left-Right
gif

Up-Down
gif

  • "Done" button's title
toolbar.doneButtonTitle = "👇"

gif

  • Change button color
toolbar.backButtonTintColor = .red
toolbar.forwardButtonTintColor = .green
toolbar.doneButtonTintColor = .purple

// or set all together
toolbar.setButtonsTintColor(.red)

gif

  • Get current/previous/next input
toolbar.currentInput
toolbar.previousInput
toolbar.nextInput

if let activeTextField = toolbar.currentInput as? UITextField {
    // ...
}
  • Update Inputs
let newInputs: [FormInput] = [emailTextField, passwordTextField]
toolbar.set(inputs: newInputs)
  • Go forward when UITextField's return key pressed
func textFieldShouldReturn(_ textField: UITextField) -> Bool {
    toolbar.goForward()
    return true
}

Requirements

  • iOS 9.0+
  • Xcode 8.2.1+
  • Swift 3.0+

Installation

Manually Install

Download all *.swift files and put your project.

Change log

Change log is here.

Communication

  • If you found a bug, open an issue.
  • If you have a feature request, open an issue.
  • If you want to contribute, submit a pull request.💪

License

FormToolbar is under MIT license. See the LICENSE file for more info.