UISlider has no tags.
To get the behavior you specified, you have to round the number returned by the slider to the nearest integer.
So, when you start to slide, and the slider reports a value of 0.1 or 0.2, round it to 0. Until it reaches 0.5, when you round to 1.
Then, when the slider stops sliding, you can set its value with the number to which you have rounded, which will make the slider “tied” to this position, like snapping to a tick mark.
If you need visual markings, you will have to implement this yourself.
source share