- Add uitextfield to storyboard.
- Inherit from TextFieldFloatingPlaceholder.
- Optionally set the following properties.
property | effect |
---|---|
floatingPlaceholderMinFontSize |
Font size when raised |
floatintPlaceholderDuration |
Animation Duration |
floatingPlaceholderColor |
Font Color |
validationFalseLineEditingColor |
Underline color under editing and validation NG |
validationTrueLineEditingColor |
Underline color under editing and validation OK |
validationFalseLineColor |
Underline color under not editing and validation NG |
validationTrueLineColor |
Underline color under not editing and validation OK |
validation |
Varidation closure |
To run the example project, clone the repo, and run pod install
from the Example directory first.
- iOS 9.0 or later
- Xcode 9.x
- Swift 4.x
TextFieldFloatingPlaceholder supports installation via the package managers Carthage and CocoaPods.
- Add
github "taiking/TextFieldFloatingPlaceholder"
to your Cartfile. - Run
carthage update
.
Add the followings to your Podfile:
use_frameworks!
pod "TextFieldFloatingPlaceholder"
Run pod install
.
TextFieldFloatingPlaceholder is available under the MIT license. See the LICENSE file for more info.