attribute to be the username and then the tweet text. The Accessibility Inspector showed that the new AXValue was indeed what I had set it to. However, VoiceOver still reads just the tweet text. I also tried specifying the Title attribute, which seemed like a perfect solution
but that didn't seem to have any impact at all.
I have since been able to get VoiceOver to read what I want, but it is not a very elegant solution. The only way I could figure it out was to basically lie to VO and tell it that my cell was static text and then supply the text I wanted read. Unfortunately, while the cell reads itself correctly, interacting with the text within the cell no longer works well at all. It seems to get offset and not read entire words. I would like if there was a way for VoiceOver to read the appropriate thing for the cell, but still have the user be able to interact with the tweet text normally.
- (BOOL)accessibilityIsIgnored {
return NO;
}
- (NSArray *)accessibilityAttributeNames {
if(validAXAttributes == nil) {
validAXAttributes = [[NSArray alloc] initWithObjects:NSAccessibilityRoleAttribute,
NSAccessibilityRoleDescriptionAttribute,
NSAccessibilityHelpAttribute,
NSAccessibilityValueAttribute,
NSAccessibilityEnabledAttribute,
NSAccessibilityFocusedAttribute,
NSAccessibilityParentAttribute,
NSAccessibilityWindowAttribute,
NSAccessibilityTopLevelUIElementAttribute,
NSAccessibilityPositionAttribute,
NSAccessibilitySizeAttribute, nil];
}
return validAXAttributes;
}
- (id)accessibilityAttributeValue:(NSString *)attribute
{
if([attribute isEqualToString:NSAccessibilityRoleAttribute]) //AXRole
return NSAccessibilityStaticTextRole;
if([attribute isEqualToString:NSAccessibilityRoleDescriptionAttribute]) //AXRoleDescription
return @"Timeline Tweet";
if([attribute isEqualToString:NSAccessibilityHelpAttribute]) //AXHelp
return @"Timeline Tweet";
if([attribute isEqualToString:NSAccessibilityValueAttribute]) { //AXValue
SRXTimelineTableView* parentTableView = [super accessibilityAttributeValue:NSAccessibilityParentAttribute];
SRXTweetObject* tweet = [parentTableView tweetForSelectedRow];
return [NSString stringWithFormat:@"%@: %@",[tweet.user displayName], tweet.text];
}
return [super accessibilityAttributeValue:attribute];
}
_______________________
Mickey Roberson
MRR Software