In SwiftUI you won't find the .notEnabled accessibility trait. Instead, you can just configure a view as such with .disabled(true), and pass false to enable it. VoiceOver will announce it as "dimmed".

https://developer.apple.com/documentation/swiftui/view/disabled(:)

The start analyzing button in the Stock Analyzer app is disabled. It is enabled once the user toggles on that they understand Stock Analyzer is not responsible for any profits or losses based on the insights gathered in the app. We call .disabled(_: ) in the button and pass the $checked state as a parameter, which is the state of the toggle.

You may also find interesting...

There are a ton of things to love about SwiftUI. But one of my favorites it's got to be the possibility of previewing Variants: the possibility of seeing your UI in dark/light modes, all dynamic type sizes, and orientations, side-by-side.

Have you noticed that the first time you select an element on Apple Podcast's mini player, VoiceOver says "Mini player", and then, it describes the selected element? It gives the user more context on what "feature" those elements belong to. This can be achieved in UIKit by configuring the accessibility container type of the mini player with .semanticGroup and giving it an accessibility label, in this case: "Mini player". https://developer.apple.com/documentation/objectivec/nsobject-swift.class/accessibilitycontainertype https://developer.apple.com/documentation/uikit/uiaccessibilitycontainertype/semanticgroup

@NSSpain has a great history of having amazing accessibility talks in their schedule! “Accessibility in the Real World”, by @Sommer: https://vimeo.com/235317172 “How to build an app for everyone”, by @NovallSwift: https://vimeo.com/362163043 The super fun "Choose your own SwiftUI adventure - 3 Accessibility", by @twostraws and @PinkerStraws: https://vimeo.com/481768105 And, of course, this year's great "Bas: My Accessibility Story", by @basthomas: https://vimeo.com/751176747

Created in Swift with Ignite.

Supporting Swift for Swifts