Skip to content

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

License

Notifications You must be signed in to change notification settings

fanta1ty/TTextField

Repository files navigation

LOGO

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

Swift 5.0 Version License Platform Email

Example

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

Requirements

  • iOS 11.0+
  • Swift 5

Installation

From CocoaPods

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

pod 'TTextField'

Second, install TProgressHUD into your project:

pod install

Swift Package

TTextField is designed for Swift 5. To depend on the logging API package, you need to declare your dependency in your Package.swift

.package(url: "https://github.com/fanta1ty/TTextField.git", brand: "master"),

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()

til

Author

fanta1ty, thinhnguyen12389@gmail.com

License

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

About

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

Topics

Resources

License

Stars

Watchers

Forks