Search code examples
iphoneobjective-cuisliderlogarithm

Use UISider to generate a logarithmic scale of values


Is there a way to got the values outputted by a UISlider in an iPhone app to increase exponentially? For example the first third generate 1 -10, the second third generate 11 to 100, and the final third generate 101 to 1000?


Solution

  • You can compute yourself the log/exp value from the slider, and display this value !

    But if you want a value between 1 to 1000, you can set min of the slider to 0, max to 3 and make the power of 10:

    powf(10.0,mySlider.value)