I have a method to insert hyperlinks into parts of a UILabel text using attributed string (underlined range). So a label might have none, one or more links to it. There is a tap gesture on the label, on which I can determine which part of the text the user is touching and trigger the appropriate action. This part is all tested and works fine.
When it comes to accessibility voice over it doesn't work very well. Only scenario that works is to set the whole label to be accessed by using:
LabelMessage.IsAccessibilityElement = true;
LabelMessage.AccessibilityTraits = UIAccessibilityTrait.Link;
My difficulty lies on having the user to be able to click on links inside that label with voice over. Voice over doesn't know that there are links inside that label. So it reads the whole label as one. I would like the voice over to read the label but when user clicks on part of the text that has a link, voice over would highlight just that part of the text and with a double click the action would be performed. I am not even aware that this is even achievable. Any insights on this matter would be really appreciated.
The best solution so far for this problem is to use UIAccessibilityCustomAction as @Junior Jiang mentioned on one of the comments.
Rotors are definitely not the solution. However, rotors can be used for UITextView as they have UITextRange property which can be used to navigate throughout the text.
Custom actions are much simpler to use than rotors and they work at the label level.