TTextField is developed to help developers can initiate a fully standard textfield including title

TTextField

TTextField is developed to help developers can initiate a fully standard textfield including title, placeholder and error message in fast and convinient way without having to write many lines of codes

Example

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

Requirements

Installation

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

pod 'TTextField'

Usage

import TTextField
  1. Initiate TTextField
let textField = TTextField()
  1. To show title, please input into title property
textField.title = "Email address"
  1. To show the placeholder, please input into placeholder property
textField.placeholder = "Enter your work email address"
  1. To enable/disable underline, please setup into isUnderline property
textField.isUnderline = true
  1. To show error message, please input into errorMessage property
textField.errorMessage = "The e-mail address entered is incorrect"
  1. To change settings more deeply, you can refer to the following functions and properties:

- underlineWidth: CGFloat
- inactiveUnderlineColor: UIColor
- inputRectLeftInset: CGFloat
- extraSpacingTitle: CGFloat
- appearanceFont: AppearanceFont
- errorImage: UIImage
- showsCaret: Bool

- func applyErrorUnderlineStyle()
- func applyNonErrorUnderlineStyle()

Requirements

  • iOS 9.3 or later
  • Swift 5.0 or later

Author

fanta1ty, thinhnguyen12389@gmail.com

License

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

GitHub

View Github