A beautiful and flexible text field control implementation of "Float Label Pattern". Written in Swift.

Overview

SkyFloatingLabelTextField

Build Status Coverage Status Pod Platform Pod License

Pod Version Carthage compatible Documentation Readme Score

SkyFloatingLabelTextField is a beautiful, flexible and customizable implementation of the space saving "Float Label Pattern". This design enables adding context to input fields that are visible at the time of typing, while minimizing the additional space used to display this additional context. This component is used in the Skyscanner TravelPro iOS application in several places, like when searching for flights.

On top of implementing the space-saving floating title, the component also supports using iconography, RTL text support (e.g. Arabic & Hebrew), various states (error, selected, highlighted states), and is very much customizable and extensible.

Versioning

Up until version 1.2 Swift 2.2 and 2.3 compatible (and there is a Swift 2.3 branch in case you need it). From version 2.0 onwards only compatible with Swift 3. Please be mindful of the version you're using.

Usage

To start using the component add it to your project using CocoaPods, Carthage or manually as per the Installation section.

The UI component can be used via the SkyFloatingLabelTextField class. To use icons on the right hand side, use the SkyFloatingLabelTextFieldWithIcon class. This control can be used very similar to UITextField - both from Interface Builder, or from code.

To create an instance of the class, use Interface builder, or do it from code. This example will create the following textbox with the placeholder and title:

let textField = SkyFloatingLabelTextField(frame: CGRect(x: 10, y: 10, width: 200, height: 45))
textField.placeholder = "Name"
textField.title = "Your full name"
self.view.addSubview(textField)

Colors

To customize the colors of the textfield, set a few properties - either from code, or from Interface builder. To use a textfield with an icon, utilize the SkyFloatingLabelTextFieldWithIcon class (and bundle the font class with your app). This example will change colors for the textfield on the right:

let lightGreyColor = UIColor(red: 197/255, green: 205/255, blue: 205/255, alpha: 1.0)
let darkGreyColor = UIColor(red: 52/255, green: 42/255, blue: 61/255, alpha: 1.0)
let overcastBlueColor = UIColor(red: 0, green: 187/255, blue: 204/255, alpha: 1.0)

let textField1 = SkyFloatingLabelTextField(frame: CGRect(x: 10, y: 10, width: 120, height: 45))
textField1.placeholder = "First name"
textField1.title = "Given name"
self.view.addSubview(textField1)

let textField2 = SkyFloatingLabelTextField(frame: CGRect(x: 150, y: 10, width: 120, height: 45))
textField2.placeholder = "Last name"
textField2.title = "Family name"

textField2.tintColor = overcastBlueColor // the color of the blinking cursor
textField2.textColor = darkGreyColor
textField2.lineColor = lightGreyColor
textField2.selectedTitleColor = overcastBlueColor
textField2.selectedLineColor = overcastBlueColor

textField2.lineHeight = 1.0 // bottom line height in points
textField2.selectedLineHeight = 2.0
self.view.addSubview(textField2)

Icons and fonts

Use the SkyFloatingLabelTextFieldWithIcon field to display icons next to the textfields. You have the option of using a font or an image as the icon by setting the iconType property (Default = IconType.font). If using an image as icon, you will have to set the iconImage property. If using a font as icon, you will have to set the iconFont property and bundle your icon with your app (if it's not a built in one). Icons can be rotated and more precise positioning is also supported:

Using a font

let overcastBlueColor = UIColor(red: 0, green: 187/255, blue: 204/255, alpha: 1.0)
let textFieldFrame = CGRect(x: 150, y: 10, width: 120, height: 45)

let textField1 = SkyFloatingLabelTextFieldWithIcon(frame: textFieldFrame, iconType: .font)
textField1.placeholder = "Departure"
textField1.title = "Flying from"
textField1.iconFont = UIFont(name: "FontAwesome", size: 15)
textField1.iconText = "\u{f072}" // plane icon as per https://fortawesome.github.io/Font-Awesome/cheatsheet/
self.view.addSubview(textField1)

let textField2 = SkyFloatingLabelTextFieldWithIcon(frame: textFieldFrame)
textField2.placeholder = "Arrival"
textField2.title = "Flying to"
textField2.tintColor = overcastBlueColor
textField2.selectedTitleColor = overcastBlueColor
textField2.selectedLineColor = overcastBlueColor

// Set icon properties
textField2.iconType = .font
textField2.iconColor = UIColor.lightGrayColor()
textField2.selectedIconColor = overcastBlueColor
textField2.iconFont = UIFont(name: "FontAwesome", size: 15)
textField2.iconText = "\u{f072}" // plane icon as per https://fortawesome.github.io/Font-Awesome/cheatsheet/
textField2.iconMarginBottom = 4.0 // more precise icon positioning. Usually needed to tweak on a per font basis.
textField2.iconRotationDegrees = 90 // rotate it 90 degrees
textField2.iconMarginLeft = 2.0
self.view.addSubview(textField2)

Using an image

let textFieldframe = CGRect(x: 150, y: 10, width: 120, height: 45)

let textField1 = SkyFloatingLabelTextFieldWithIcon(frame: textFieldframe, iconType: .image)
textField1.placeholder = "Departure"
textField1.title = "Flying from"
textField1.iconImage = UIImage(imageLiteralResourceName: "PlaneIcon")
self.view.addSubview(textField1)

Error state and delegates

The textfield supports displaying an error state - this can be useful for example when validating fields on the fly. When the errorMessage property is set on the control, then the control is highlighted with the color set in the errorColor property.

To get notified of different events happening on the textfield - such as the text changing, editing starting or ending - just set the func addTarget(_ target: Any?, action: Selector, for controlEvents: UIControl.Event) with the .editingChanged. also can set the delegate property to a class implementing the standard UITextFieldDelegate protocol:

class MyViewController: UIViewController, UITextFieldDelegate {
    override func viewDidLoad() {
        super.viewDidLoad()
        let textField1 = SkyFloatingLabelTextField(frame: CGRect(x: 10, y: 10, width: 120, height: 45))
        textField1.placeholder = "Email"
        textField1.title = "Email address"
        textField1.errorColor = UIColor.redColor()
        textField1.addTarget(self, action: #selector(textFieldDidChange(_:)), for: .editingChanged)
        self.view.addSubview(textField1)
    }
    
    // This will notify us when something has changed on the textfield
    @objc func textFieldDidChange(_ textfield: UITextField) {
        if let text = textfield.text {
            if let floatingLabelTextField = textField as? SkyFloatingLabelTextField {
                if(text.characters.count < 3 || !text.containsString("@")) {
                    floatingLabelTextField.errorMessage = "Invalid email"
                }
                else {
                    // The error message will only disappear when we reset it to nil or empty string
                    floatingLabelTextField.errorMessage = ""
                }
            }
        }
    }
}

Disabled state

The textfield also supports displaying a disabled state. When the isEnabled property is set on the control, then the control is highlighted with the color set in the disabledColor property.

    textField.disabledColor = disabledColor
    textField.isEnabled = false

RTL language support

The component automatically detects the language writing direction. When the phone has a RTL language set (e.g. Arabic or Hebrew), then it automatically adjusts to support this style.

Alternatively, set the isLTRLanguage property to manually change the writing direction.

Further customizing the control by subclassing

The control was designed to allow further customization in subclasses. The control itself inherits from UITextField, so the standard overrides from there can all be used. A few other notable customization hooks via overriding are:

  • updateColors: override this method to customize colors whenever the state of the control changes
  • Layout overrides:
    • titleLabelRectForBounds(bounds:CGRect, editing:Bool): override to change the bounds of the top title placeholder view
    • textRectForBounds(bounds: CGRect): override to change the bounds of the control (inherited from UITextField)
    • editingRectForBounds(bounds: CGRect): override to change the bounds of the control when editing / selected (inherited from UITextField)
    • placeholderRectForBounds(bounds: CGRect): override to change the bounds of the placeholder view
    • lineViewRectForBounds(bounds:CGRect, editing:Bool): override to change the bounds of the bottom line view

Documentation

See the SkyFloatingLabelTextField documentation on CocoaDocs.org for the full documentation.

Installation

CocoaPods

The control is available through CocoaPods. CocoaPods can be installed using Ruby gems:

$ gem install cocoapods

Then simply add SkyFloatingLabelTextField to your Podfile:

pod 'SkyFloatingLabelTextField', '~> 3.0'

Lastly, let CocoaPods fetch the latest version of the component by running:

$ pod update
Integrating into Objective C projects

When integrating the component into an Objective C project, in the Podfile add use_frameworks!. For example as shown in SkyFloatingLabelTextFieldObjectiveCExample:

use_frameworks!

target 'SkyFloatingLabelTextFieldObjectiveCExample' do
  pod 'SkyFloatingLabelTextField', '~> 3.0'
end

Then to use the component in your code, add the following line to your .h or .m files:

@import SkyFloatingLabelTextField;

Carthage

The component supports Carthage. Start by making sure you have the latest version of Carthage installed. Using Homebrew run this:

$ brew update
$ brew install carthage

Then add SkyFloatingLabelTextField to your Cartfile:

github "Skyscanner/SkyFloatingLabelTextField"

Finally, add the framework to the Xcode project of your App. Link the framework to your App and copy it to the App’s Frameworks directory via the “Build Phases” section.

Manual

You can download the latest files from our Releases page. After doing so, copy the files in the Sources folder to your project.

Contributing

We welcome all contributions. Please read this guide before opening issues or submitting pull requests, as well as how and who to contact with questions.

Credits

The original component was built by Daniel Langh, Gergely Orosz and Raimon Laupente. Notable contributions by Shai Shamir (RTL language support).

Credits for the original design, and improving it with iconography to Matt D. Smith (@mds).

FAQ

  • Can I use it in Objective C projects?

    Of course! Please see the Integrating-into-Objective-C-projects section on how to integrate the component via CocoaPods.

  • Does the control work well with auto layout? What about using it programmatically?

    The control was built to support both use cases. It plays nicely with autolayout. As the control is a subclass of UITextField, overriding textRectForBounds(bounds:) or editingRectForBounds(bounds:) is always an option. Alternatively, overriding intrinsiccontentsize is also another possibility.

  • How can I remove the line from the bottom of the textfield?

    Set lineHeight and selectedLineHeight to 0, and the line won't be displayed.

  • I'd like to validate the textfield using the errorMessage. How can I re-validate text is typed in the textfield?

    Using a delegate implement the textField(textField:,range:string:) method. This method fires whenever the text is changed - do the validation here. Alternatively, using subclassing you can also override the becomeFirstResponder method to e.g. clear the text or error message when the textfield is selected.

Issues
  • Migrate to Swift 3

    Migrate to Swift 3

    Hey!

    Since we need this framework working for our app, we wanted to help with migration to Swift 3.

    What's in this PR?

    • [x] Migrated SkyFloatingLabelTextField framework and unit test target to Swift 3 syntax
    • [x] Migrated example target to Swift 3
    • [x] Verified that all unit tests pass
    • [x] Verified that example app functions properly
    • [x] Switched to Xcode 8 for running tests on Travis CI
    • [x] Added .swift-version file to allow properly linting podspec when you are ready to release

    I did not do any Swift API design guidelines-related changes, i thought that as library authors, you would probably want to make those choices yourselves. I would be happy to help with other issues of Swift 3 transition, if they arise.

    Thanks for awesome library, and hope this PR will be helpful.

    opened by DenTelezhkin 28
  • Customize errorMessage position

    Customize errorMessage position

    Error messages can be set above or below textfield

    opened by rethink-eder 25
  • fix: set the text alignment to .Natural so it will be presented according to the language alignment rules (RTL support)

    fix: set the text alignment to .Natural so it will be presented according to the language alignment rules (RTL support)

    Since iOS 9 the default value for text alignment is .Natural In iOS 8 you must set the value ignorer to get the correct alignment when changing languages. Originally Labels in iOS 8 didn't have the .Natural alignment value.

    opened by pichirichi 25
  • Swift 3.0

    Swift 3.0

    Thanks for great library. Are you planning to publish a swift3 branch? When I tried to build it in Swift 3, it gives 78 error.

    enhancement 
    opened by enescakir 22
  • Shared is unavailable: use view controller based solutions where appropriate instead.

    Shared is unavailable: use view controller based solutions where appropriate instead.

    screen shot 2017-06-19 at 4 43 28 pm

    This error is occurring for me. Any suggestions?

    question needs more info 
    opened by bradlgray01 20
  •  Type 'NSAttributedStringKey' (aka 'NSString') has no member 'foregroundColor'

    Type 'NSAttributedStringKey' (aka 'NSString') has no member 'foregroundColor'

    Just updated my Xcode and using swift 4. Xcode = Version 9.0 (9A235) iOS version 10.0 pod --version 1.3.1

    When I try to change target swift version to 3.2 I get this error screen shot 2017-10-02 at 1 42 47 pm screen shot 2017-10-02 at 1 43 07 pm

    Then changing it to swift 4 I get 6 errors mentioned in See #158

    screen shot 2017-10-02 at 1 46 33 pm
    opened by AbdulazizAlmohsen 15
  • Build fails in Xcode 9 beta 3

    Build fails in Xcode 9 beta 3

    It's not possible to build the project on Xcode beta 3:

    screenshot 2017-07-21 08 26 56

    Changing the Swift Language Settings to 3.2 has no effect.

    opened by Babelfisch 14
  • @discardableResult for becomeFirstResponder() and resignFirstResponder()

    @discardableResult for becomeFirstResponder() and resignFirstResponder()

    When calling textField.becomeFirstResponder() or textField.resignFirstResponder() Xcode warns:

    Result of call to 'becomeFirstResponder()' is unused Result of call to 'resignFirstResponder()' is unused

    In the example code this is avoided by prefixing all instances with _ = ..., but i like to keep my code clean, so the better solution is to add @discardableResult to those functions in source. This way the result can be used just like before, if needed, but it doesn't have to be used.

    opened by bennokress 14
  • Text is not set to right while select arabic language from app

    Text is not set to right while select arabic language from app

    I have implemented localization Internally(To change language inside app) in app by using this github repo : ios_language_manager

    While changing language from app (Not iPhone language) from English to Arabic it is not changing UITextFiled's placeholder text and value to RTL. But if I change the iPhone language to Arabic then it works perfectly.

    Both of the below textfield's text alignment is natural from storyboard. Without text input only placeholder text (Placeholder should come from right side) screen shot 2017-02-21 at 12 36 22 pm

    With text input and floating placeholder (Text should come from right side) screen shot 2017-02-21 at 12 36 49 pm

    If I change language from iPhone settings then it works perfectly.

    Without text input only placeholder text (Perfect) screen shot 2017-02-21 at 12 46 53 pm

    With text input and floating placeholder (Perfect) screen shot 2017-02-21 at 12 47 11 pm

    question 
    opened by ibhavin 13
  • Icon showing up as question mark

    Icon showing up as question mark

    I added the fontawesome pod but its still not showing when i use foodTextField.iconFont = UIFont(name: "FontAwesome", size: 15) foodTextField.iconText = "\u{f072}"

    I'm using swift3

    question 
    opened by Hsanka6 13
  • Wrong behaviour on error state.

    Wrong behaviour on error state.

    Report

    What did you do?

    ℹ I have added latest version and try to use textfield with validation and have problems with error colors.

    What did you expect to happen?

    Expect to have error color on title and text.

    What happened instead?

    Only title was colored with error color, but text has black color. It looks like different symbols, eg. "@" "," "." break some logic with colors.

    Снимок экрана 2021-11-18 в 23 54 00

    Environment

    ℹ Please fill in this section with information about your environment

    Xcode Version: 13.1 SkyFloatingLabelTextField Version: 4.0 Deployment Target: iOS 15+ Base SDK: Method of Integration: CocoaPods

    Project that demonstrates the issue

    ℹ Please link to a project we can download that reproduces the issue if applicable.

    Here is small video that shows wrong behaviour. https://user-images.githubusercontent.com/14241858/142494756-d89314b8-6d9e-436e-b061-984ac865432d.mov

    Here is the code, where I change error message, there is no other code that work with textfield. Снимок экрана 2021-11-18 в 23 52 24

    opened by alexeybolv 0
  • Add Support for Swift Package Manager

    Add Support for Swift Package Manager

    Add Support for Swift Package Manager

    Since Most of the projects are Migrating to Swift Package Manager, we want this wonderful Library to add Support for Swift Package Manager

    opened by MohanabalanD 0
  • added annotation to silence xcode 13 beta 3 errors

    added annotation to silence xcode 13 beta 3 errors

    https://github.com/Skyscanner/SkyFloatingLabelTextField/issues/331

    opened by sofili 0
  • Compiler error 'shared' is unavailable in application extensions for iOS with SPM and Xcode 13 beta 3

    Compiler error 'shared' is unavailable in application extensions for iOS with SPM and Xcode 13 beta 3

    Report

    What did you do?

    Integrating SkyFloatingLabelTextField version 4.0.0 with Swift Package Manager and Xcode 13 beta 3 (13A5192i).

    What did you expect to happen?

    Library compiles without errors.

    What happened instead?

    Compiler emits error 'shared' is unavailable in application extensions for iOS: Use view controller based solutions where appropriate instead. SkyFloatingLabelTextField.swift line 33

    This error appears due to the changes in the linker mentioned in the Xcode release notes

    Resolved in Xcode 13 Beta 3

    Linking Swift packages from application extension targets or watchOS applications no longer emits unresolvable warnings about linking to libraries not safe for use in application extensions. This means that code referencing APIs annotated as unavailable for use in app extensions must now themselves be annotated as unavailable for use in application extensions, in order to allow that code to be used in both apps and app extensions. (66928265)

    All libraries that use API marked as unavailable in iOS app extensions, such as UIApplication.shared, have to mark their code themself with @available(iOSApplicationExtension, unavailable) in Swift and NS_EXTENSION_UNAVAILABLE in Objective-C.

    Environment

    Xcode Version: 13 beta 3 (13A5192i) SkyFloatingLabelTextField Version: 4.0.0 Deployment Target: iOS 11.4 Base SDK: 15.0 Method of Integration: Swift Package Manager

    opened by martinknabbe 1
  • Update Objective-C example for Xcode 12 and fix Carthage build

    Update Objective-C example for Xcode 12 and fix Carthage build

    I couldn't build it with Carthage in our work project since schemes in Obj-C example were shared

    So I deleted unused example and updated the rest, it seems to be working fine now. Maybe it's even better to remove Obj-C examples entirely, what do you think?

    opened by havebeenfitz 0
  • Attributed text support

    Attributed text support

    Adds support for using setting the attributedText property of the UITextField.

    Setting this value was always possible of course, but the logic of SkyFloatingLabelTextField in reaction to other changes (eg isEnabled, active, not active etc) always calls updateColors() which in turn calls updateTextColor() which in setting the textColor value of the UITextField overrides any color attributes that have been set in the attributedText, making it basically unusable.

    With this change, if attributedText is set to a non-nil value, any changes to textColor are ignored, and internally the attributed string will remain unchanged when updateTextColor() is called, except to set it to the error color in the case of an error.

    opened by mluisbrown 0
  • single color with Reusability

    single color with Reusability

    Hello,

    can I use this text field using the .xib file? for reusability? can you please provide an example?

    opened by smohammedyasin 0
  • Bump json from 2.2.0 to 2.3.1

    Bump json from 2.2.0 to 2.3.1

    Bumps json from 2.2.0 to 2.3.1.

    Changelog

    Sourced from json's changelog.

    2020-06-30 (2.3.1)

    • Spelling and grammar fixes for comments. Pull request #191 by Josh Kline.
    • Enhance generic JSON and #generate docs. Pull request #347 by Victor Shepelev.
    • Add :nodoc: for GeneratorMethods. Pull request #349 by Victor Shepelev.
    • Baseline changes to help (JRuby) development. Pull request #371 by Karol Bucek.
    • Add metadata for rubygems.org. Pull request #379 by Alexandre ZANNI.
    • Remove invalid JSON.generate description from JSON module rdoc. Pull request #384 by Jeremy Evans.
    • Test with TruffleRuby in CI. Pull request #402 by Benoit Daloze.
    • Rdoc enhancements. Pull request #413 by Burdette Lamar.
    • Fixtures/ are not being tested... Pull request #416 by Marc-André Lafortune.
    • Use frozen string for hash key. Pull request #420 by Marc-André Lafortune.
    • Added :call-seq: to RDoc for some methods. Pull request #422 by Burdette Lamar.
    • Small typo fix. Pull request #423 by Marc-André Lafortune.

    2019-12-11 (2.3.0)

    • Fix default of create_additions to always be false for JSON(user_input) and JSON.parse(user_input, nil). Note that JSON.load remains with default true and is meant for internal serialization of trusted data. [CVE-2020-10663]
    • Fix passing args all #to_json in json/add/*.
    • Fix encoding issues
    • Fix issues of keyword vs positional parameter
    • Fix JSON::Parser against bigdecimal updates
    • Bug fixes to JRuby port
    Commits
    • 0951d77 Bump version to 2.3.1
    • ddc29e2 Merge pull request #429 from flori/remove-generate-task-for-gemspec
    • cee8020 Removed gemspec task from default task on Rakefile
    • 9fd6371 Use VERSION file instead of hard-coded value
    • dc90bcf Removed explicitly date field in gemspec, it will assign by rubygems.org
    • 4c11a40 Removed task for json_pure.gemspec
    • e794ec9 Merge pull request #426 from marcandre/indent
    • 7cc9301 Merge pull request #428 from marcandre/change_fix
    • 9e2a1fb Make changes more precise #424
    • f8fa987 Merge pull request #424 from marcandre/update_changes
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Fix `intrinsicContentSize`

    Fix `intrinsicContentSize`

    Currently, if no frame or auto layout constraints are set, intrinsicContentSize.width is always zero, which is a bug.

    In a standard UITextField, intrinsicContentSize.width is wide enough to display the placeholder text. SkyFloatingLabelTextField should also have the same minimum, and not just be zero.

    opened by mluisbrown 0
Releases(3.8.0)
  • 3.8.0(Dec 5, 2019)

    • A new tag format for release has been introduced to be compatible with Swift Package Manager(SPM). The new format does not include the v prefix in tag names. This will be the case for all tags going forward, previous v prefix tags remain in place and new tags without the v prefix has been pushed for these commits too.
    • Added support for Swift Package Manager #296. Thanks to acecilia.
    • Added support for Swift 5 #290. Thanks to jessemx109.
    Source code(tar.gz)
    Source code(zip)
  • v3.6.0(Sep 20, 2018)

  • v3.5.2(Aug 27, 2018)

  • v3.5.1(May 29, 2018)

  • v3.5.0(May 28, 2018)

  • v3.4.1(Mar 27, 2018)

  • v3.3.0(Nov 1, 2017)

  • v3.2.0(Jul 4, 2017)

  • v3.1.0(Apr 19, 2017)

  • v3.0.0(Mar 7, 2017)

    Breaking

    Change implementation of amimation callbacks to include boolean completed flag.

    Before

    textfield.setTitleVisible(false, animated: true) {
    	// Perform callback actions
    }
    

    Now

    textfield.setTitleVisible(false, animated: true) { completed in
    	// Perform callback actions using completed flag
    }
    

    See (#112)[https://github.com/Skyscanner/SkyFloatingLabelTextField/pull/112]

    Source code(tar.gz)
    Source code(zip)
  • v2.0.1(Jan 16, 2017)

    • Added @discardableResult to becomeFirstResponder and resignFirstResponder. This silences Xcode warnings about unused results of those functions and brings the implementation closer to the iOS API #98. Thanks to bennokress
    • Disable GCC_GENERATE_TEST_COVERAGE_FILES and GCC_INSTRUMENT_PROGRAM_FLOW_ARCS in release configs. This was causing rejections when submitting to Apple when the library is integrated manually or with Carthage #97. Thanks to vytautasgimbutas
    Source code(tar.gz)
    Source code(zip)
  • v2.0.0(Dec 7, 2016)

  • v1.3.1(Nov 30, 2016)

    The tag pointed to in .podspec was not updated in the 1.3 release causing it to still point to 1.2.1 instead of 1.3. This release fixes that and correctly points the podspec to the right git tag.

    Source code(tar.gz)
    Source code(zip)
  • v1.3(Nov 30, 2016)

  • v1.2.1(May 19, 2016)

  • v1.2.0(Apr 21, 2016)

    • Added RTL language support
    • Changed the behaviour of errorMessage, removing unnecessary business logic.
      • Before this change there was some "hidden" business logic around the resetting of errorMessage, namely:
        • Whenever the control was selected by a user, it got cleared (becomeFirstResponder invoked)
        • Whenever the text changed, it also got reset (when textField(textField:,range:string:) was invoked)
      • After this change what's different:
        • The errorMessage is no longer reset by any text or focus changes. If a developer sets this message, the error will be displayed, until this property is cleared. To implement the previous functionality, just subscribe to the textField(textField:,range:string:) event on the delegate
        • As a side effect of this, the workaround of double-invoking textField(textField:,range:string:) has been removed, fixing the bug raised by this Issue
    Source code(tar.gz)
    Source code(zip)
  • v1.1.1(Apr 6, 2016)

    • Bugfix: setting the error message via the textField?(shouldChangeCharactersInRange:replacementString:) method is now possible
    • Added example on how to use the control from Objective C
    Source code(tar.gz)
    Source code(zip)
  • v1.1(Apr 4, 2016)

    • Changed the control to inherit from the UITextField class (previously the control inherited from UIControl)
    • The delegate to use with the textfield is now the UITextFieldDelegate (removed the delegate:SkyFloatingLabelTextFieldDelegate class)
    • Removed placeHolderLabel, textField and hasText properties from SkyFloatingLabelTextField class
    • Removed textRectForBounds(bounds: CGRect) and placeholderLabelRectForBounds(bounds:CGRect) methods from SkyFloatingLabelTextField
    • The above methods have been replaced with the UITextfield methods editingRectForBounds(bounds: CGRect) and placeholderRectForBounds(bounds: CGRect) on SkyFloatingLabelTextField
    • Added placeholderFont, editingOrSelected properties to SkyFloatingLabelTextField class
    Source code(tar.gz)
    Source code(zip)
  • v1.0.6(Mar 11, 2016)

    Removed the hideKeyboardWhenSelected property. This property seemed too specific. To hide the keyboard when selecting a field, an alternative workaround is to set the textField.inputView property to an empty view.

    Source code(tar.gz)
    Source code(zip)
  • v1.0.5(Mar 10, 2016)

    • Added the hideKeyboardWhenSelected property
    • Bugfix: When invoking becomeFirstResponder on a textField that was not yet visible, the keyboard did not show up.
    Source code(tar.gz)
    Source code(zip)
  • v1.0.1(Mar 1, 2016)

Owner
Skyscanner
Skyscanner
Easy-to-use token field that is used in the Venmo app.

VENTokenField VENTokenField is the recipients token field that is used in the Venmo compose screen. Installation The easiest way to get started is to

Venmo 792 Nov 1, 2021
UITextField and UITextView subclasses with placeholders that change into floating labels when the fields are populated with text.

Deprecated Please use JVFloatLabeledTextField instead or feel free to chime in on an issue if you'd like to take over the repo. RPFloatingPlaceholders

rob phillips 1.1k Nov 6, 2021
A text view that supports selection and expansion

The Problem UILabel and UITextView offer unsatisfying support for text selection. Existing solutions like TTTAttributedLabel are great but offer a som

Jeff Hurray 634 Oct 28, 2021
Declarative text styles and streamlined Dynamic Type support for iOS

StyledText StyledText is a library that simplifies styling dynamic text in iOS applications. Instead of having to use attributed strings every time yo

Blue Apron 233 Jun 12, 2021
UITextField-based control for (NS)Measurement values input.

MeasurementTextField UITextField-based control for (NS)Measurement values input. Provides type-safe keyboard and picker based input of different measu

Siarhei Fiedartsou 16 Jul 22, 2021
ARAutocompleteTextView is a subclass of UITextView that automatically displays text suggestions in real-time. This is perfect for automatically suggesting the domain as a user types an email address, #hashtag or @alexruperez.

ARAutocompleteTextView Overview ARAutocompleteTextView is a subclass of UITextView that automatically displays text suggestions in real-time. This is

Alex Rupérez 261 Oct 25, 2020
UITextField that automatically formats text to display in the currency format

CurrencyTextField The numbers that the user enters in the field are automatically formatted to display in the dollar amount format. For example, if th

Richa Deshmukh 48 Jul 27, 2021
An auto growing text input bar for messaging apps.

ALTextInputBar An auto growing text input bar for messaging apps. Written in Swift. ALTextInputBar is designed to solve a few issues that folks usuall

Alex Littlejohn 262 Oct 11, 2021
A Float Input View with smooth animation and supporting icon and seperator written with Swift

RSFloatInputView Features Smooth animation using CoreText Support optional left icon Support optional seperator Configurable padding, size, fonts and

null 105 May 6, 2021
A UITextView subclass that adds support for multiline placeholder written in Swift.

KMPlaceholderTextView A UITextView subclass that adds support for multiline placeholder written in Swift. Usage You can set the value of the placehold

Zhouqi Mo 761 Nov 6, 2021
Awesome TextField is a nice and simple libriary for iOS and Mac OSX. It's highly customisable and easy-to-use tool. Works perfectly for any registration or login forms in your app.

Awesome TextField is a nice and simple libriary for iOS and Mac OSX. It's highly customisable and easy-to-use tool. Works perfectly for any registrati

Alexander Shoshiashvili 222 Nov 6, 2021
An auto-layout base UITextView subclass which automatically grows with user input and can be constrained by maximal and minimal height - all without a single line of code

Deprecated This library is no longer maintained and is deprecated. The repository might be removed at any point in the future. MBAutoGrowingTextView A

Matej Balantič 126 Apr 16, 2021
A simple and easily customizable InputAccessoryView for making powerful input bars with autocomplete and attachments

InputBarAccessoryView Features Autocomplete text with @mention, #hashtag or any other prefix A self-sizing UITextView with an optional fixed height (c

Nathan Tannar 882 Nov 16, 2021
VKPinCodeView is simple and elegant UI component for input PIN. You can easily customise appearance and get auto fill (OTP) iOS 12 feature right from the box.

Features Variable PIN length Underline, border and custom styles The error status with / without shake animation Resetting the error status manually,

Vladimir Kokhanevich 90 Nov 17, 2021
An UITextView in Swift. Support auto growing, placeholder and length limit.

GrowingTextView Requirements iOS 8.0 or above Installation CocoaPods GrowingTextView is available through CocoaPods. To install it, simply add the fol

Kenneth Tsang 803 Nov 15, 2021
A Swift framework for parsing, formatting and validating international phone numbers. Inspired by Google's libphonenumber.

PhoneNumberKit Swift 5.3 framework for parsing, formatting and validating international phone numbers. Inspired by Google's libphonenumber. Features F

Roy Marmelstein 4.4k Nov 22, 2021
iOS - Subclass of UITextField to achieve autocompletion for Place Search like Google Places, Uber and Much more apps having maps.

MVAutocompletePlaceSearchTextField iOS - Subclass of UITextField to achieve autocompletion for Place Search like Google Places, Uber and Much more app

Mrugrajsinh Vansadia 69 Jul 29, 2021
A light-weight UITextView subclass that automatically grows and shrinks.

RSKGrowingTextView A light-weight UITextView subclass that automatically grows and shrinks based on the size of user input and can be constrained by m

Ruslan Skorb 928 Nov 15, 2021
UITextField with underline and left image

TJTextField UITextField with underline and left image Version: 1.0 Features Add image in UITextField Left text pedding Underline whole UITextField Sho

Tejas Ardeshna 45 Oct 19, 2020