i am using an UIslider first time. first i want to know how to gat value of slider positon if the range of value is 0 to 10:
second i want my slider just set at 5 different values . like 1, 2, 3, 4, 5
slider should not set between the labeled value
first u set textfiled and add this function into code
In this case I set the slider in XCode to have values of: 0-3. But the slider value is float: 0.000 - 3.000.
}
}
}
}
On valueChanged action, (step 1) I set the value to rigid values: 0, 1, 2, 3. And (step 2) I stick the slider thumb to the rigid values if it get close by 0.3 from the rigid value.
On touchUpInside & touchUpOutside I repeat 'step 1' code from valueChanged action to fix the slider value for the case that the drag action end outside the stick range ('step 2').
The best is to put all this code in a sub-class of Slider. But this is my only first week / attempt on iOS development.
I followed this tutorial for mine and it was very helpful there are variables you can set in the code such as max number and how much the slider increases each time. Link: http://www.xprogress.com/post-35-uislider-tutorial-example-how-to-use-slider-in-iphone-sdk-xcode/