I am trying to disable accessibility for all of the UI elements that appear on my screen. Afterwards my plan is to re-enable only specific elements based on the user's interactions with the app.
I've been trying to accomplish this by passing self.view to the following method:
- (void)disableSubviewsOfView:(UIView *)view
{
NSArray *subviews = [view subviews];
for (UIView *subview in subviews)
{
[subview setIsAccessibilityElement:NO];
[self disableSubviewsOfView:subview];
}
}
It should be noted that for some reason the guy that originally wrote this code decided to stack UIViews on top of each other so there are elements still appearing in the background.
I'm wondering, is there a way that I can disable accessibility of ALL elements, not necessarily just the ones contained in a specific UIView?