Availability: UISlider UIControlEventValueChanged is not sent when slider.value is set to voice mode

I have a UISlider in my parent view. I want to honor the Voice transmission gestures for moving the slider, and thus I applied the accessibilityIncrement and accessibilityDecrement methods, as shown below:

- (void)accessibilityIncrement { float finalValue = self.value; finalValue = (finalValue + 1); if (finalValue > self.maximumValue) finalValue = self.maximumValue; self.value = finalValue; } - (void)accessibilityDecrement { float finalValue = self.value; finalValue = (finalValue - 1); if (finalValue < self.minimumValue) finalValue = self.minimumValue; self.value = finalValue; } 

The problem is when I set the value of the slider (using self.value = finalValue), the selector for the UIControlEventValueChanged event is not called. This is mistake?

Thanks!

+4
source share

Source: https://habr.com/ru/post/1446391/


All Articles