Skip to content

Latest commit

 

History

History
83 lines (58 loc) · 2.41 KB

README.md

File metadata and controls

83 lines (58 loc) · 2.41 KB

FloatableTextField

CI Status Version License Platform Swift 4.0

Example

Alt Text

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

Swift version 4.0+

Xcode 9.0+

Installation

FloatableTextField is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'FloatableTextField'

Usage

  1. Add a TextField in your viewcontroller view.
  2. Set the class for the TextField to FloatableTextField
  3. Create an outlet for the textField in your viewcontroller class
@IBOutlet weak var floatTextField: FloatableTextField!

FloatableTextFieldDelegate

FloatableTextFieldDelegate is similar as UITextFieldDelegate.

floatTextField.floatableDelegate = self

Set State Icon

In order to enable the state icon, add the Footer Image as defaultImage.png in yout Attribute Inspector.

Set State message

func setState(_ state: State, with message: String = "")

For Default Message

floatTextField.setState(.DEFAULT, with: "Default State Message")

Enable State Button Action

You can configure state button action to display your own info or popups.

floatTextField.onStateButtonClick = {
// Action
}

Enable DropDown

To enable DropDown you jst have to set the Is DropDown Enbaled to Yes in your attribute inspector And configure the dropDown Action as following in your view controller

floatTextField.onDropdownClick = {
    // Action
}

Author

prashantLalShrestha, prashantlurvs@gmail.com

License

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