Accessibility: UISlider's UIControlEventValueChanged is not posted when slider.value is set in Voice-over mode
Asked Answered
A

1

6

I am having a UISlider in my parent view. I want to honor the Voice-over gestures for slider movement and thus, i have implemented accessibilityIncrement and accessibilityDecrement methods as 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 issue is when I set the value of the slider (using self.value = finalValue), the selector for UIControlEventValueChanged event does not get called. Is this a Bug?

Thanks!

Avow answered 16/11, 2012 at 7:41 Comment(1)
Figured out a work-around with the help of a friend, [self sendActionsForControlEvents:UIControlEventValueChanged]; can be used inside accessibilityIncrement and accessibilityDecrement functions to achieve the same.Avow
G
0

A recommended solution for a UISlider with VoiceOver consists in using a delegate in your code with the increment and decrement methods you already use to adapt the slider value according to the knob location.

Guidance answered 5/11, 2018 at 13:45 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.