Home > Back-end >  iOS, Accessibility - accessibilityElementsHidden = NO; does not take immediate effect
iOS, Accessibility - accessibilityElementsHidden = NO; does not take immediate effect

Time:09-16

Setting self.listViewController.view.accessibilityElementsHidden = NO; does not take immediate effect.

There is a fraction of a second when you can still swipe right with accessibility, accessibility focus jump to that listViewController and remains there, blocked from the main view that covers listViewController

self.listViewController.view.accessibilityElementsHidden = NO; is the first thing that I do in a method that is passed to button.addtarget and its still too slow to disable selected subviews.

What could be the reason for that?

Thank you.

CodePudding user response:

A friend of mine helped me with the solution.

We used..

UIAccessibilityPostNotification(UIAccessibilityLayoutChangedNotification, nil);

..to update the new screen, right after the sender triggered the layout changes, and right after hiding self.listViewController.view.accessibilityElementsHidden = NO;

We set the second parameter to nil, as it takes some fraction of time for the notification to refocus.

  • Related