UITextField and UITextView subclasses with placeholders that change into floating labels when the fields are populated with text.

Overview

Deprecated

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

RPFloatingPlaceholders

UITextField and UITextView subclasses with placeholders that change into floating labels when the fields are populated with text.

Used by millions of people in the Booking.com app! Is your app using it? Let me know!

Please see the included example app for sample usage.

Support this project via Gratipay

Options:

Animate upward (default)

Upwards animation

Animate downward

Downwards animation

Supports:

ARC & iOS 6+, Autolayout or springs and struts

Apps using it:

  • Booking.com — Used by millions of people around the world to book hotels.

A little help from my friends:

Please feel free to fork and create a pull request for bug fixes or improvements, being sure to maintain the general coding style and adding comments as necessary.

Thanks to the following people for their help:

Credit:

Credit for the design concept goes to Matt D. Smith.

Comments
  • Show floating label without animation when text is set programmatically

    Show floating label without animation when text is set programmatically

    Thanks for a great library! This tweak is to prevent the unwanted floating label animation when loading a textfield programmatically (as when loading a form with pre-filled values). This works fine for me, but please let me know if you recommend a better solution.

    opened by martinrybak 2
  • check if floating label color were set before awakeFromNib

    check if floating label color were set before awakeFromNib

    If you setup a RPFloatingPlaceholders instance in Xib/Storyboard and setup the floating label colors when overriding the setter in the viewController nothing happens because awakeFromNib es called after.

    opened by nandodelauni 2
  • update label and placholder on programatic update of text (after init)

    update label and placholder on programatic update of text (after init)

    reusing -[*TextDidChange:] handlers to update the label and placeholder when manually changing the text via -[setText:]

    Without this, something like self.textView.text = nil; would not properly update the placeholder and floating label


    Also implemented the default initializer for UITextView which allows initializing with a custom NSLayoutManager and, therefore, it's associated TextKit compatriots (ie. NSTextStorage and NSTextContainer)

    opened by spinosa 2
  • Fix for placeholder alignment issue

    Fix for placeholder alignment issue

    Now the placeholder text aligns in the middle of the RPFloatingPlaceholderTextField just like as in the the default UITextField irrespective of the height of the box

    Before: before

    After : after

    opened by giridharvc7 2
  • if you change the floating label active color whilst editing it chang…

    if you change the floating label active color whilst editing it chang…

    …es when you set it.

    For example, if you are using the floating label to indicate whether or not the input you are writing match some logic (re-enter password field, specific handle or password rules) it may be interesting to allow changing the active color.

    Let me know if you find this interesting.

    Thanks!

    opened by nandodelauni 1
  • adding iOS 6 compatibility.

    adding iOS 6 compatibility.

    It's pretty much 1:1 feature-wise. with the exception of setting the textContainerInset. I could not find a suitable replacement for that in iOS 6 but it is probably not a big deal. My main purpose here was to get the component functional and usable in iOS 6 while folks are still trying to support it.

    opened by DimaVartanian 1
Owner
rob phillips
If I only scrape a living, at least it's a living worth scraping. If there's no future in it, at least it's a present worth remembering.
rob phillips
Floating-textfield-swiftui - Floating textfield swiftui: Floating field with multiple icons

floating_textfield-swiftui Hey, Guys welcome to this tutorial. In this complete

Patrick 0 Jan 2, 2022
This project will add a done button on your UITextField and UITextView

This project will add a done button on your UITextField and UITextView

Botla Venkatesh 0 Nov 23, 2021
Animated UITextField and UITextView replacement for iOS

AnimatedTextInput iOS custom text input component used in the Jobandtalent app. Installation Use cocoapods to install this custom control in your proj

jobandtalent 757 Dec 15, 2022
Floating-textfield-swiftui - Floating textfield With SwiftUI

floating_textfield-swiftui Hey, Guys welcome to this tutorial. In this complete

null 1 Feb 11, 2022
Lightweight set of text fields with nice animation and functionality

TweeTextField This is lightweight library that provides different types of Text Fields based on your needs. I was inspired by Jan Henneberg. Features

Oleg 471 Nov 10, 2022
ARAutocompleteTextView is a subclass of UITextView that automatically displays text suggestions in real-time

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.

Alex Rupérez 261 Jun 29, 2022
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 49 Sep 28, 2022
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č 125 Jan 13, 2022
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 939 Dec 21, 2022
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 941 Jan 5, 2023
A light-weight UITextView subclass that adds support for placeholder.

RSKPlaceholderTextView A light-weight UITextView subclass that adds support for placeholder. Installation Using Swift Package Manager To add the RSKPl

Ruslan Skorb 220 Dec 17, 2022
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 795 Nov 18, 2022
DGPlaceholderTextView - A light-weight UITextView that supports for placeholder

DGPlaceholderTextView Requirements Installation Usage Properties DGPlaceholderTe

donggyu 5 Jan 26, 2022
Transition from any SwiftUI Text view into an inline navigation bar title when the view is scrolled off-screen, as seen in Apple's TV & TestFlight iOS apps.

SwiftUI Matched Inline Title Transition from any SwiftUI Text view into an inline navigation bar title when the view is scrolled off-screen, as seen i

Seb Jachec 19 Oct 9, 2022
DTTextField is a custom textfield with floating placeholder and error label

DTTextField Introduction DTTextField is a UITextField library with floating placeholder and error label. Floating placeholder inspired from JVFloatLab

Dhaval Thanki 310 Jan 5, 2023
🏄‍♂️ UITextField-Navigation makes it easier to navigate between UITextFields and UITextViews

' __________________ _______ _________ _______ _________ _______ _ ______ ' |\ /|\__ __/\__ __/( ____ \|\ /

Thanh Pham 446 Nov 24, 2022
Animated Subclass of UITextField created with CABasicAnimation and CAShapeLayer

JDAnimatedTextField JDAnimatedTextField is animateable UITextField that can significantly enhance your user's experiences and set your app apart from

Jawad Ali 25 Dec 13, 2022
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 68 May 27, 2022
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 44 May 16, 2022