How can I set accessibilityIdentifier to UIAlertController?

前端 未结 4 1635
梦毁少年i
梦毁少年i 2021-02-05 05:56

This is how I simply create UIAlertController and present it on the screen:

private class func showAlertWithTitle(title: String, message: String) {
         


        
4条回答
  •  遇见更好的自我
    2021-02-05 06:24

    From Apple docs...

    https://developer.apple.com/library/content/documentation/UserExperience/Conceptual/UIKitUICatalog/UIAlertView.html

    Making Alert Views Accessible

    Alert views are accessible by default. Accessibility for alert views pertains to the alert title, alert message, and button titles. If VoiceOver is activated, it speaks the word “alert” when an alert is shown, then speaks its title followed by its message if set. As the user taps a button, VoiceOver speaks its title and the word “button.” As the user taps a text field, VoiceOver speaks its value and “text field” or “secure text field.”

提交回复
热议问题