https://github.com/fanta1ty/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
https://github.com/fanta1ty/ttextfield
cocoapods component error error-message errormessage framework library message placeholder pod swift swift5 text textfield ui ui-components ui-design uikit uikit-components uikit-framework
Last synced: 8 months ago
JSON representation
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
- Host: GitHub
- URL: https://github.com/fanta1ty/ttextfield
- Owner: fanta1ty
- License: mit
- Created: 2022-07-31T13:51:34.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2023-06-09T06:48:50.000Z (over 2 years ago)
- Last Synced: 2025-01-01T02:03:40.306Z (about 1 year ago)
- Topics: cocoapods, component, error, error-message, errormessage, framework, library, message, placeholder, pod, swift, swift5, text, textfield, ui, ui-components, ui-design, uikit, uikit-components, uikit-framework
- Language: Swift
- Homepage:
- Size: 359 KB
- Stars: 9
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README

# 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
[](https://developer.apple.com/swift/)
[](https://cocoapods.org/pods/TTextField)
[](https://cocoapods.org/pods/TTextField)
[](https://cocoapods.org/pods/TTextField)
[](thinhnguyen12389@gmail.com)
## 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](https://cocoapods.org). To install
it, simply add the following line to your Podfile:
```ruby
pod 'TTextField'
```
Second, install `TProgressHUD` into your project:
```ruby
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`
```swift
.package(url: "https://github.com/fanta1ty/TTextField.git", brand: "master"),
```
## Usage
```swift
import TTextField
```
1) Initiate ``TTextField``
```swift
let textField = TTextField()
```
2) To show title, please input into ``title`` property
```swift
textField.title = "Email address"
```
3) To show the placeholder, please input into ``placeholder`` property
```swift
textField.placeholder = "Enter your work email address"
```
4) To enable/disable underline, please setup into ``isUnderline`` property
```swift
textField.isUnderline = true
```
5) To show error message, please input into ``errorMessage`` property
```swift
textField.errorMessage = "The e-mail address entered is incorrect"
```
6) To change settings more deeply, you can refer to the following functions and properties:
```swift
- underlineWidth: CGFloat
- inactiveUnderlineColor: UIColor
- inputRectLeftInset: CGFloat
- extraSpacingTitle: CGFloat
- appearanceFont: AppearanceFont
- errorImage: UIImage
- showsCaret: Bool
- func applyErrorUnderlineStyle()
- func applyNonErrorUnderlineStyle()
```

## Author
fanta1ty, thinhnguyen12389@gmail.com
## License
TTextField is available under the MIT license. See the LICENSE file for more info.