Skip to content

Latest commit

 

History

History
100 lines (61 loc) · 2.68 KB

README.md

File metadata and controls

100 lines (61 loc) · 2.68 KB

HDNTextField

CI Status Version License Platform Carthage compatible

Requirements

  • iOS 8+

Example

iPhone

How to Use

Using from Storyboard

Xcode

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

Code

let textField = HDNTextField()

Properties

// This property applies a padding to the placeholder. Ex: CGPoint(x: 10, y: 0).
textField.placeholderInsets = CGPoint(x: 10, y: 0)

// The color for the placeholder when the Textfield is inactive.
textField.placeholderInactiveColor = .lightGrayColor() 

// The color for the placeholder when the Textfield is active.
textField.placeholderActiveColor = .blueColor()

// The background color for the placeholder.
textField.placeholderBackgroundColor = .clearColor()

// The background color for the textfield when it's active.
textField.textFieldActiveBackgroundColor = .clearColor()

//  The background color for the textfield when it's inactive.
textField.textFieldInactiveBackgroundColor = .clearColor() 

// The color for the text when the textfield is inactive.
textField.textInactiveColor = .blackColor() 

// The color for the text when the textfield is active.
textField.textActiveColor = .blackColor()

// The corner radius for the textfield as a whole.
textField.textFieldCornerRadius = 3.0

// This property defines the size of the editable area.
textField.textFieldInsets = CGPoint(x: 10, y: 0)

// The color of the border when the textfield is not active.
textField.borderInactiveColor = .lightGrayColor() 

// The color of the border when it is active.
textField.borderActiveColor = .blueColor() 

Installation

Using CocoaPods

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

pod "HDNTextField"

Using Carthage

Add the following to your Cartfile:

github "hdoria/HDNTextField"

Author

Hugo Doria, [email protected]

License

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