How to set warning message availability label in iOS?

I have UIAlertControllera message. I want the warning message availability label to be different from the warning message line.

How can i do this?

+4
source share
1 answer

you can find each element UIControlusing an array subviews.

For example, if you want to change accessibilityLabelyours UIAlertController, you can do this:

let contentTitleForAlert = myAlertController.view.subviews[0].subviews[0].subviews[0].subviews[0].subviews[0].subviews[0]
        contentTitleForAlert.accessibilityLabel = "¡My text for accessibility label"

Using this method, you can change other elements in UIAlertController. For example:

let contentLabelForAlert = myalertController.view.subviews[0].subviews[0].subviews[0].subviews[0].subviews[0].subviews[1]
        contentLabelForAlert.accessibilityLabel = "Text for accessibilityLabel for main content in UIAlertController."
0
source

Source: https://habr.com/ru/post/1625119/


All Articles