Skip to content

Custom UITextField with floated placeholder and an underline.

License

Notifications You must be signed in to change notification settings

NovichenkoAnton/LineTextField

Repository files navigation

LineTextField

Custom UITextField with floated placeholder and an underline.

Version License Platform

Requirenments

  • iOS 9.0+

Installation

CocoaPods

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

pod 'LineTextField', '~> 1.0'

Usage

import LineTextField

//Connect IBOutlet
@IBOutlet var lineTextField: LineTextField!

//Create programmatically
let lineTextField = LineTextField(frame: CGRect(x: 20, y: 400, width: view.frame.width - 40, height: 35))
lineTextField.floatingPlaceholder = true

Bottom line

You can specify default and active color for bottom line for LineTextField.

lineTextField.lineColorDefault = UIColor.red
lineTextField.lineColorActive = UIColor.blue

bottom line

These properties are available for change in Interface Builder.

Floating placeholder

You can use floating placeholder

lineTextField.floatingPlaceholder = true

and specify text color for active/inactive state of floating placeholder

lineTextField.floatingPlaceholderColor = UIColor.red
lineTextField.floatingPlaceholderActiveColor = UIColor.blue

floating placeholder

These properties are available for change in Interface Builder.

Demo

You can see other features in the example project.

About

Custom UITextField with floated placeholder and an underline.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published