Not a big question however I am facing a dilemma. I am implementing some iOS UI Testing and I am unable to set the Accessibility Identifier required for the framework to my UITableView.
That whole section does not seem to be present in the Identity Inspector in interface builder.
Please see screenshot attached.
I attempted to do it programatically but it did not work as well.
I set the accessibility identifier as enabled and its value in viewDidLoad()
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view
// set delegate and data source
tableView.delegate = self;
tableView.dataSource = self;
// load the table Data
tableData = ["Red", "Green", "Blue", "White", "Yellow"]
// set accessibility identifier
tableView.isAccessibilityElement = true
tableView.accessibilityIdentifier = "tableView"
}
It is just a sample app where I am testing the actual framework.
Any help is welcome.
I am using XCode 7.3.1
Try this:
tableView.accessibilityLabel = "My tableView label"
tableView.isAccessibilityElement = true
Refer this for more details on accessibility
for tableView
: Enhance the Accessibility of UITableView
Not identifier, set accessibilityLabel, frameworks use that usually
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With