美文网首页iOS资源库
iOS-ParkedTextField Swift开源库介绍

iOS-ParkedTextField Swift开源库介绍

作者: Stark_Dylan | 来源:发表于2015-08-14 23:56 被阅读55次

    ParkedTextField

    A text field subclass with a constant text in the end.

    Main functionality works. It is still under development.

    Screenshot

    ParkedTextField.gifParkedTextField.gif

    Usage

    ParkedTextField is available through CocoaPods and Carthage. To install
    it, simply add the following lines to your Podfile:

    use_frameworks!
    pod "ParkedTextField"
    

    Or add the following lines to your Cartfile:

    github "gmertk/ParkedTextField" "master"
    

    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. Defaults to "".
    var parkedText: String = ".slack.com" 
    
    /// Placeholder next to parkedText. Defaults to "".
    var placeholderText: String = "yourteam" 
    
    /// Variable part of the text. Defaults to "".
    var typedText: String
    
    /// Font of parkedText. Defaults to bold version of the text field's font if it exists. If not, defaults to the font of the text field.
    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 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.

    相关文章

      网友评论

      本文标题:iOS-ParkedTextField Swift开源库介绍

      本文链接:https://www.haomeiwen.com/subject/pilwqttx.html