I have four points on UISlider at 0, 1, 2 and 3. I want that when thumb position is from 0-1, it should come back to 0 but with elastic effect. Similar for 1-2, 2-3. This implementation will give me an edge in my application.
I have tried it with no elastic effect. But it does not look good.
Tell your slider to send an action on the “Touch Up Inside” event (
UIControlEventTouchUpInside). Hook the action up to this method:You can use
truncfinstead ofroundfif that’s what you really want.