Limit sliding UISlider past certain point

前端 未结 3 1827
终归单人心
终归单人心 2021-01-19 03:06

Let\'s assume a have a UISlider to which I set a certain value. The slider handle then moves to that value, as expected.

Now I want to let the user sli

3条回答
  •  旧时难觅i
    2021-01-19 03:34

    This one is very easy, actually :)

    Create an action and assign it as selector for valueChanged action of UISlider. Inside that method, perform a simple check: If slider's value is less than 50, set it to 50.

    If you need any further help, I can write some sample code after my class. Hope it helps!

提交回复
热议问题