I am using the KIF Framework for functional UI testing. Let's say I am on a current iPad screen where many views (labels, buttons, textfields etc) have unique accessibility labels assigned. If I have the accessibilityLabel
string handy, can I get a reference to the associated UIView
from current screen using it?
For example, [[UIView alloc] viewWithTag:5]
returns UIVIew
of provided tag
. I am looking for something like [[UIView alloc] viewWithAccessiblityLabel:@"my label"]
.
P.S: I know the brute-force method would be to iterate all views in self.subviews recursively, and compare accessibility label to find what am I searching for. I am looking for a better approach.
subclass
UIView
in urCustom
classes.. – Bullion