Giter VIP home page Giter VIP logo

Comments (3)

DimaVartanian avatar DimaVartanian commented on May 22, 2024

can you attach a sample project showcasing the problem? the pull request i submitted should've made it work.

from jvfloatlabeledtextfield.

joeljfischer avatar joeljfischer commented on May 22, 2024

https://github.com/joeljfischer/Test_Floating_Label

I really hope I'm not making an ass of myself by missing something stupid.

from jvfloatlabeledtextfield.

DimaVartanian avatar DimaVartanian commented on May 22, 2024

Okay, I found the issue. JVFloatLabeledTextField depends on code to call its setter for the placeholder(- (void)setPlaceholder:(NSString *)placeholder), because that is where the text and size is set for the floating label. The nib does not call this setter when setting the placeholder so it is never called. As a quick/temporary fix, you can create an outlet in your view controller for the text field, and force a call to the setter in viewDidLoad, like this "_textField.placeholder = _textField.placeholder;" (assuming your outlet is called _textField). This will make it function normally.

As to why it is not being called, I'm not sure. I was under the impression that when setting attributes in interface builder, the system first tries to use a setter if there is one, and only is one is not found sets it directly. I would probably know more about this if I actually used storyboards and nibs, but I tend to code all my layouts.

from jvfloatlabeledtextfield.

Related Issues (20)

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.