Git Product home page Git Product logo

parkedtextfield's Introduction

ParkedTextField

Version Carthage compatible License Platform

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

Main functionality works. It is still under development.

Screenshot

ParkedTextField.gif

Usage

ParkedTextField is available through CocoaPods, Carthage, and Swift Package Manager. 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"

Or for Swift Package Manager:

  1. In Xcode, open your project and navigate to File → Swift Packages → Add Package Dependency...
  2. Paste the repository URL (https://github.com/gmertk/ParkedTextField) and click Next.
  3. For Rules, select Branch (with branch set to master).
  4. Click Finish.

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.

Authors

License

ParkedTextField is available under the MIT license. See the LICENSE file for more info.

parkedtextfield's People

Contributors

aabosh avatar chrisballinger avatar gmertk avatar gmertk-traity avatar hamsternik avatar rmzr7 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

parkedtextfield's Issues

Issues with Xcode 8 / Swift 2.3

I've fixed these issues locally but will submit a PR soon. More changes will probably be needed for Swift 3.

iOS/Pods/ParkedTextField/ParkedTextField/ParkedTextField/ParkedTextField.swift:214:35: value of optional type 'UIFontDescriptor?' not unwrapped; did you mean to use '!' or '?'?
        return UIFont(descriptor: descriptor, size: 0)

Sample project does not work

I'm getting an error saying "Cannot load underlying module for 'ParkedTextField'" when I run the sample project. I made a pod file and installed ParkedTextField but it keeps throwing a same error.

Android Version

Hi @gmertk .

This is very very nice project.

I would like to make same one by Android.

Could I publish and write your github link of ParkedTexFiled on README ?

Sorry for writing on issue. (I can't find your email.)

Carthage support...

Let's add Carthage support! It is the future! 😉 The most efficient way to do this is to create a new framework project with the Swift class and a Single View Project target for the sample project to reduce project size. What do you guys think?

Cursor starting at wrong position

When I select the text field, enter a text, deselect and select it again two bugs appeared:

  • The cursor starts at end of parked text (not at ending of typed text)
  • The font style is the same of parked text

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.