Inconsistent Propagation of .accessibilityAddTraits via .accessibilityElement(children: .contain) in SwiftUI
0 reputation · 26 Jul 2025, 13:53 UTC
The user‑facing SwiftUI workflow relies on .accessibilityAddTraits to annotate elements, yet when .accessibilityElement(children: .contain) is used the added traits may not propagate to inner views, causing inconsistent screen‑reader announcements.
Because Swift's accessibility APIs evolve across iOS 15‑17 and undocumented interactions with third‑party UI libraries can alter trait inheritance, developers lack a clear expectation about whether dynamic type scaling respects the added accessibility attributes.
Which iOS versions exhibit reliable trait propagation for .accessibilityAddTraits with .contain children? Does dynamic type scaling correctly adjust the accessibility tree when traits are added at the container level?