Skip to content

Instantly share code, notes, and snippets.

@fahied
Last active March 13, 2020 03:23
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fahied/c30d18a17e487dc6630f to your computer and use it in GitHub Desktop.
Save fahied/c30d18a17e487dc6630f to your computer and use it in GitHub Desktop.
Set Accessibility to custom UITableViewCell
In Voice-Over , in order to make an element accessible :-
1. you have to set setIsAccessibilityElement property as true which i don't find in your code.
2; The other important point is that to make child elements (subviews) to be accessible , you have to seperately make them accessible while the parent should not be accessible(you have to specify this also).
Implement the UIAccessibilityContainer Protocol in your custom - cell.
NSString *title = titleofcell;
cell.accessibilityValue = title;
cell.accessibilityLabel = [NSString stringWithFormat:@"item %ld", (long)indexPath.row];
cell.accessibilityTraits = UIAccessibilityTraitButton;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment