Latest 0.1.1
Homepage https://github.com/ldbchan/YTFloatingTitleTextField
License MIT
Platforms ios 8.0
Authors

CI Status Version License Platform

YTFloatingTitleTextField is a subclass of UITextField implemented in Objective-C. It is customizable, easy to use, and supported to use programatically or through Interface Builder. Using YTFloatingTitleTextField you’ll be able to:

  • Enable floating title while editing
  • Enable showing bottom line
  • Use different texts for title and placeholder
  • Use different styles for corresponding status (normal or error)

Usage

Through Interface Builder

  • Drag a UITextField component into your view controller
  • Go to Identity Inspector > Custom Class and change the class name to YTFloatingTitleTextField

Perks to use Interface Builder — some default configurations we did for you:

  • title will be set to be the same as placeholder
  • normalTextColor will be set to be the same as textColor
  • normalTextFont will be set to be the same as font
  • normalLineColor will be set to be the same as tintColor

In Code

It’s also really easy to use in code:

YTFloatingTitleTextField *textField = [[YTFloatingTitleTextField alloc]
initWithFrame:CGRectMake(40, 150, 200, 60)];
textField.title = @"Name";
textField.placeholder = @"What's your name?";
textField.textAlignment = NSTextAlignmentCenter;
[self.view addSubview:textField];

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

iOS 8.0+

Installation

CocoaPods

If CocoaPods isn’t installed yet, you can do it by running:

$ gem install cocoapods

Then simply add the following line to your Podfile:

pod 'YTFloatingTitleTextField'

License

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

Latest podspec

{
    "name": "YTFloatingTitleTextField",
    "version": "0.1.1",
    "summary": "A UITextField subclass with floating title and bottom line.",
    "homepage": "https://github.com/ldbchan/YTFloatingTitleTextField",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "ldbchan": "[email protected]"
    },
    "source": {
        "git": "https://github.com/ldbchan/YTFloatingTitleTextField.git",
        "tag": "v0.1.1"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "YTFloatingTitleTextField/Classes/**/*"
}

Pin It on Pinterest

Share This