We have a UITextView
that contains an attributed string with two embedded links that are created in the text view by using NSLinkAttributeName
. We are using Calabash to automate testing and calabash cannot 'tap' on the links inside of these TextViews. Is there something I'm missing that makes these links inside of UITextView
tappable to automation/accessibility tools?
The user is able to tap on these links and the expected delegate callbacks are confirmed to be working. The only case that is not working is when accessibility tools are used to try and tap the embedded links inside of the UITextView
.
For reference:
NSDictionary *plainAttributes = [self plainTextAttributes];
NSDictionary *linkAttributes = [self linkAttributes];
NSMutableDictionary *linkOneAttributes = [linkAttributes mutableCopy];
termsOfUseAttributes[NSLinkAttributeName] = @"linkOne";
NSMutableDictionary *linkTwoAttributes = [linkAttributes mutableCopy];
privacyPolicyAttributes[NSLinkAttributeName] = @"linkTwo";
NSMutableAttributedString *string = [NSMutableAttributedString new];
[string appendAttributedString:[[NSAttributedString alloc] initWithString:@"Blah blah blah blah " attributes:plainAttributes]];
[string appendAttributedString:[[NSAttributedString alloc] initWithString:@"Link One" attributes:linkOneAttributes]];
[string appendAttributedString:[[NSAttributedString alloc] initWithString:@". Blah blah blah blah" attributes:plainAttributes]];
[string appendAttributedString:[[NSAttributedString alloc] initWithString:@"Link Two" attributes:linkTwoAttributes]];
[string appendAttributedString:[[NSAttributedString alloc] initWithString:@"." attributes:plainAttributes]];
Any insight into accessibility when using NSLinkAttributeName
in UITextView
's attributed string would be greatly appreciated.