Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/novichenkoanton/linetextfield
Custom UITextField with floated placeholder and an underline.
https://github.com/novichenkoanton/linetextfield
swift uitextfield
Last synced: 5 days ago
JSON representation
Custom UITextField with floated placeholder and an underline.
- Host: GitHub
- URL: https://github.com/novichenkoanton/linetextfield
- Owner: NovichenkoAnton
- License: mit
- Created: 2020-03-30T10:10:14.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-11-04T09:04:15.000Z (10 days ago)
- Last Synced: 2024-11-04T09:06:25.716Z (10 days ago)
- Topics: swift, uitextfield
- Language: Swift
- Homepage:
- Size: 75.2 KB
- Stars: 2
- Watchers: 1
- Forks: 2
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# LineTextField
Custom UITextField with floated placeholder and an underline.[![Version](https://img.shields.io/cocoapods/v/LineTextField)](https://cocoapods.org/pods/LineTextField)
[![License](https://img.shields.io/cocoapods/l/LineTextField)](https://raw.githubusercontent.com/NovichenkoAnton/LineTextField/master/LICENSE)
[![Platform](https://img.shields.io/cocoapods/p/LineTextField)](https://cocoapods.org/pods/LineTextField)## Requirenments
- iOS 9.0+
## Installation
### CocoaPods
LineTextField is available through [CocoaPods](https://cocoapods.org). To install it, simply add the following line to your Podfile:
```ruby
pod 'LineTextField', '~> 1.0'
```## Usage
```swift
import LineTextField//Connect IBOutlet
@IBOutlet var lineTextField: LineTextField!//Create programmatically
let lineTextField = LineTextField(frame: CGRect(x: 20, y: 400, width: view.frame.width - 40, height: 35))
lineTextField.floatingPlaceholder = true
```### Bottom line
You can specify default and active color for bottom line for `LineTextField`.```swift
lineTextField.lineColorDefault = UIColor.red
lineTextField.lineColorActive = UIColor.blue
```![bottom line](https://user-images.githubusercontent.com/8337067/78116638-4b016180-740d-11ea-8b31-acebaba8c68b.gif)
These properties are available for change in Interface Builder.
### Floating placeholder
You can use floating placeholder```swift
lineTextField.floatingPlaceholder = true
```and specify text color for active/inactive state of floating placeholder
```swift
lineTextField.floatingPlaceholderColor = UIColor.red
lineTextField.floatingPlaceholderActiveColor = UIColor.blue
```![floating placeholder](https://user-images.githubusercontent.com/8337067/78119498-3626cd00-7411-11ea-85b1-6d7310e12f70.gif)
These properties are available for change in Interface Builder.
## Demo
You can see other features in the example project.