Reputation: 6707
I have got a UITableView with custom UITableViewCell CustomCell
CustomCell has a few UILabel with user interaction enabled
CustomCell implements touchesBegan:
- (void) touchesBegan:(NSSet*)touches withEvent:(UIEvent*)event {
UITouch* touch = touches.anyObject;
self.itemSelected=[touch view].tag;
self.viewSelected=[touch view];
[super touchesBegan:touches withEvent:event];
}
This works good if I don't have VoiceOver enabled, touchedBegan gets called, and the correct view is 'selected'
With VoiceOver on, touchesBegan gets called as well if I do a "double tap then hold", but the view associated with the touch event is of type UITableViewCellContentView.
Any idea how I would go about keeping those user interactions with those items inside the tableview cell?
What I've tried unsuccessfully:
- make sure that accessibility was disabled on the cell object
- make sure that accessibility was enabled on the label object
- tried various combinations of traits for the label
- make sure user interaction enabled was on label
ideas?
Upvotes: 0
Views: 1449
Reputation: 6707
found the answer
I needed to implement the following methods
- (NSInteger)accessibilityElementCount;
- (id)accessibilityElementAtIndex:(NSInteger)index;
- (NSInteger)indexOfAccessibilityElement:(id)element;
Upvotes: 2