Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CALayer has no AccessibilityIdentifier

I have built a proof of concept that creates a CAShapeLayer object and I am able to set it's AccessibilityLabel correctly. However, I am unable to set an AccessibilityIdentifier (it seems this property exists for UIView objects, but not for CALayer objects?).

Does anyone know how to access it for CALayer objects - or if it is even possible?

like image 706
Charlie Seligman Avatar asked Nov 07 '22 02:11

Charlie Seligman


1 Answers

Alladinian's suggestion above worked perfectly:

"I haven't tried it in practice, but you could adopt UIAccessibilityIdentification protocol and implement accessibilityIdentifier if you have subclassed the CALayer or even adopt the protocol in an extension of CALayer and return its name for example."

like image 101
Charlie Seligman Avatar answered Nov 12 '22 22:11

Charlie Seligman