Wie kann ich accessibilityIdentifier auf UIAlertController setzen?
So erstelle ich einfachUIAlertController
und präsentiere es auf dem Bildschirm:
private class func showAlertWithTitle(title: String, message: String) {
let alert = UIAlertController(title: title, message: message, preferredStyle: .Alert)
//alert.accessibilityLabel = "my string here" //doesnt work
let action = UIAlertAction(title: "OK", style: .Default) { action in
alert.dismissViewControllerAnimated(true, completion: nil)
}
alert.addAction(action)
UIStoryboard.topViewController()?.presentViewController(alert, animated: true, completion: nil)
}
und so greife ich darauf zu unter UITests:
emailAlert = app.alerts["First Name"] //for title "First Name"
aber ich möchte dort einen benutzerdefinierten Bezeichner festlegen und über @ darauf zugreiffirstName
so was
emailAlert = app.alerts["firstName"]
Ist es möglich