rsattar / CLTokenInputView

A replica of iOS's native contact bubbles UI
MIT License
504 stars 127 forks source link

Expose textField and fieldLabel to be styled #40

Closed dmorrow closed 7 years ago

dmorrow commented 7 years ago

In order to properly style the textField and fieldLabel, they need to be public properties.

rsattar commented 7 years ago

Thanks for the pull request!

I'm leaning towards exposing the textfield and the fieldLabel, but a couple of changes to your pull request would be good:

One of the reasons I've been hesitant to make these properties public is because now the developer can start modifying the textfield and fieldLabel in ways that breaks CLTokenInputView. For example, they might make themselves the delegate of the textField, or start changing the size of the fieldLabel.

Another approach to "exposing" these properties would be make styling methods where CLTokenInputView will call the developer's handler block (with the textField or fieldLabel as the parameter in that block), and the developer can provide styling safely there, without exposing the internals of CLTokenInputView.

If you've already moved on from wanting to work on this pull request, that's totally fine; just let me know, and I'll make the changes myself.

dmorrow commented 7 years ago

@rsattar If you can make the changes in the way that you're comfortable with, that's probably for the best. I think that exposing the textField and fieldLabel as parameters in a styling block would have the same issues as exposing them in the .h file. If someone wants to break it, they will find a way.

dmorrow commented 7 years ago

I've approached this from a different direction. See PR #44