Xcode UIAutomation can't interact with TTTAttributedLabel

755 Views Asked by At

I'm trying to write automation scripts for my app and my problem is that Xcode UI Automation just can't see the elements of TTTAttributedLabel class. Getting full elements tree shows no sign of those TTTAttributedLabel elements. I'm using Xcode 6.1.1

1

There are 1 best solutions below

0
On BEST ANSWER

By default TTTAttributedLabel isn't an accessibility element. It works as custom container and provides accessibility for links/phones and other detected data. To change this behaviour subclass TTTAttributedLabel and override methods of UIAccessibilityElement protocol.

E.g. return YES in -(BOOL)isAccessibilityElement method and TTTAttributedLabel will work as UILabel