Darkseal / DownPicker

A lightweight DropDownList / ComboBox for iOS, written in Objective-C
MIT License
202 stars 93 forks source link

Small modifications #2

Closed qaziatiq closed 9 years ago

qaziatiq commented 9 years ago

This is a great Control for a very common issue of having a dropdown in iOS. I used it in a project, found two small things (might be more of a cosmetic stuff).

  1. I wanted the picker to show a previously selected value when it popped up, so added a few lines of code to do that. Now when you use picker to select a value and then again click the text field it shows the previously selected value, instead of the first option.
  2. If first time you clicked option one in the picker, and clicked done it did not reflect in the textfield, because the value change did not occur, I have added a small workaround, to select the first value if user clicks done (nothing is selected if the picker is dismissed).
Darkseal commented 9 years ago

Merged with my master branch: thanks a lot for the contribution!

fmaylinch commented 9 years ago

Thanks @qaziatiq and @Darkseal! I wanted to do something like that. :smile:

Just a little comment. I've seen that the text property doesn't get the default value.

I would choose one of these options: 1- Set it. 2- Make it a "virtual property" linked to textField.text. 3- Remove that property and just use textField.text when necessary. (I would choose this one).

Darkseal commented 9 years ago

I like the option 2 the most, so I implemented it using the getter/readonly Obj-C pattern: it should be now fully interchangeable with textField.text. Let me know if you like it.

fmaylinch commented 9 years ago

Perfect, thanks!