UISlider evaluate the result once they have stoppe

2019-07-01 22:22发布

问题:

I have a UI slider that is continuous. I take the value as it changes and use it to calculate a value that i put into a textfield.

I have the value changed outlet linked to the method that does the calculation and that works ok but i also want a method to fire once the user lifts off the slider that effectively gives a once time evaluation of the final set value.

I have tried connecting the the did end on exit method and others available .

回答1:

Use the UISlider's UIControlEventTouchUpInside event and, if necessary the UIControlEventTouchUpOutside event. These events will be triggered when the user lifts their finger off the UISlider. Which one is called will depend on whether the finger is inside or outside the bounds of the UISlider when it is lifted.



标签: uislider