To use one slider for 3 textfields you are going to need to implement some mechanism for choosing which textfield is attached to the slider.
You could include a button next to each textfield that when pressed executes a method that connects the slider to that field.
or
You could use a segmented switch with 3 buttons near the slider that performs the same function as the textfield buttons.
If you really must use only 1 slider, maybe you could divide the slider range into 3 equal amounts, like 1 - 10, 11-20, 21- 30. Then when the slider value passes into a new range it switches connection to a new textfield.
Clunky and confusing for the user, and probably awkward to code, but probably doable.
Or I guess as knapps mentioned above, all the textfields are connected, but each one receives a filtered value from its respective range on the slider.
You could use some if statements that perform the math conversion to your desired values when the slider value is within a particular range. The other textfields would not get a new value until the slider moved into its range.
Still awkward though, because to get to any one textfield you have to move the slider to the extreme values of the other textfields, thus changing their values to an undesired value.
I'd say use buttons or 3 sliders.
__________________
Learning IOS development one crash at a time.
|