Make Accessibility Inspector recognize SwiftUI Button State

i have a Custom button in SWIFTUI but when I run the accessibility inspector and it focuses on button it only says the title and type.

how can I get it to say whether it is enabled or not
As far as I know, there is no way to do this.

However, you can add labels to the button, or just hide it from the user if it is disabled.
You can use any of the following modifiers:
.accessibility(label: buttonIsDisabled ? Text("This button is disabled") : Text("This is a button"))
.accessibility(hidden: buttonIsDisabled)
where buttonIsDisabled is a boolean property.
The enabled state of a button is controlled by the .disabled modifier. And then you should be able to see the "Not Enabled" trait in the inspector.
I was able to get it working and heard it as expected on my physical device with VoiceOver but Accesibilty Inspector didn’t announce the “dim” part it only said “ button title, Button”
Make Accessibility Inspector recognize SwiftUI Button State
 
 
Q