mirror of
https://github.com/zhigang1992/ParkedTextField.git
synced 2026-04-24 04:15:28 +08:00
8fed21f7ad474f5d539c170cd98c7b298c3a96e4
ParkedTextField
A text field subclass with a constant text in the end.
Main functionality works. It is still under development.
Screenshot
Usage
ParkedTextField is available through CocoaPods. To install it, simply add the following lines to your Podfile:
use_frameworks!
pod "ParkedTextField"
Setup
If you want to use storyboards, just drop a TextField into your storyboard and set its class to ParkedTextField. Then customize through the attributes inspector or code. Otherwise, you can write the code to initialize with frame and set the properties.
Properties
/// Constant text in the end of text field. Defaults to "".
var parkedText: String = ".slack.com"
/// Font of parkedText. Defaults the text field's font or its bold version if it exists.
var parkedTextFont: UIFont!
/// Color of parkedText. Defaults the font's color.
var parkedTextColor: UIColor!
Development
- Instead of subclassing UITextField, investigate making a UITextField extension.
- Test with emojis.
- Test setting placeholder and text. In some cases it breaks the parkedText.
Author
Günay Mert Karadoğan, mertkaradogan@gmail.com
License
ParkedTextField is available under the MIT license. See the LICENSE file for more info.
Languages
Swift
89%
Ruby
6.3%
Objective-C
4.7%
