To run the example project, clone the repo, and run pod install
from the Example directory first.
Swift version 4.0+
Xcode 9.0+
FloatableTextField is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'FloatableTextField'
- Add a TextField in your viewcontroller view.
- Set the class for the TextField to FloatableTextField
- Create an outlet for the textField in your viewcontroller class
@IBOutlet weak var floatTextField: FloatableTextField!
FloatableTextFieldDelegate is similar as UITextFieldDelegate.
floatTextField.floatableDelegate = self
In order to enable the state icon, add the Footer Image as defaultImage.png in yout Attribute Inspector.
func setState(_ state: State, with message: String = "")
For Default Message
floatTextField.setState(.DEFAULT, with: "Default State Message")
You can configure state button action to display your own info or popups.
floatTextField.onStateButtonClick = {
// Action
}
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
}
prashantLalShrestha, prashantlurvs@gmail.com
FloatableTextField is available under the MIT license. See the LICENSE file for more info.