user1046037 user1046037 - 5 months ago 72
iOS Question

Prevent voice over (Accessibility) from announcing UITableViewCell as selected

When a UITableViewCell is selected, voice over announces "selected", I don't want voice over to say "selected". How can i achieve this ?

Things I have tried with no success:


  • Changed the cell
    accessibilityHint
    and
    accessibilityLabel

  • Changed the cell
    selectionStyle = UITableViewCellSelectionStyleNone

  • changed the cell
    accessibilityTraits = UIAccessibilityTraitButton



Question:


  • I don't want voice over to say "selected" when a cell is selected. How can i achieve this ?


Answer

The only work around is prevent cell selection

- (NSIndexPath *)tableView:(UITableView *)tableView willSelectRowAtIndexPath:(NSIndexPath *)indexPath;
{
    return nil;
}

Add a Tap gesture on the cell and when the cell is tapped, do the what ever you want in cell selection inside the tap gesture.