Skip to content

A subclassed UITextField that follows the Float Label UI design pattern.

License

Notifications You must be signed in to change notification settings

itworx/UIFloatLabelTextField

 
 

Repository files navigation

UIFloatLabelTextField

A subclassed UITextField that implements the Float Label UI design pattern.


Note

If you are looking for the UITextView equivalent of this class, please visit my UIFloatLabelTextView repository.

About

In 2013, Matt D. Smith unveiled the Float Label user interface design pattern. In short, it retains a text field's placeholder above said text field as a floating label. This label is brightly colored when the field is active, and dimly colored when a user has finished editing that field.

Sample Gif of Library in Action

Image credit: Matt D. Smith.

Changelog (v1.1.2)

  • Minor change to how clear button is accessed and modified

Features

  • Works with all view init styles
    • Visual Formatting Language (for programmatic NSAutoLayout)
    • Manual Frame Initialization
    • Storyboards and Xibs
  • Works with all NSTextAlignments
  • Support for disabling all default UIMenuController options
    • E.g., Paste, Copy, Cut, Select, Select All
  • Animations
    • Animation when toggling UILabel visibility
    • Animation when clearing text

Installation

pod 'UIFloatLabelTextField'

Usage

Check out UIFloatLabelTextField.h for a full list of editable properties. Also, check out the UIFloatLabelSampleApp for an example impementation of the application.

Credit

I want to credit Jared Verdi for developing the first iOS implementation of this pattern in his JVFloatLabeledTextField project. I used it as a reference to make this version, but executed most aspects differently. I also added many other features that I personally needed, and plan on continuing to enhance this library over time.

Created and maintained by

Arthur Ariel Sabintsev

License

Please refer to the LICENSE file.

About

A subclassed UITextField that follows the Float Label UI design pattern.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Objective-C 95.5%
  • Ruby 4.5%