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
To run the example project, clone the repo, and run pod install
from the Example directory first.
- iOS 11.0+
- Swift 5
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
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"),
import TTextField
- Initiate
TTextField
let textField = TTextField()
- To show title, please input into
title
property
textField.title = "Email address"
- To show the placeholder, please input into
placeholder
property
textField.placeholder = "Enter your work email address"
- To enable/disable underline, please setup into
isUnderline
property
textField.isUnderline = true
- To show error message, please input into
errorMessage
property
textField.errorMessage = "The e-mail address entered is incorrect"
- 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()
fanta1ty, thinhnguyen12389@gmail.com
TTextField is available under the MIT license. See the LICENSE file for more info.