Unable to Add Accessibility Trait to UISegmentedControl

I’m trying to add the .header accessibility trait to a UISegmentedControl so that VoiceOver recognizes it accordingly. However, setting the trait using the following code doesn’t seem to have any effect:

segmentControl.accessibilityTraits = segmentControl.accessibilityTraits.union(.header)

Even after applying this, VoiceOver doesn’t announce it as a header. Is there any workaround or recommended approach to achieve this?

What exactly are you trying to do? UISegmentedControl, is a toggle, not a header type of element.

Unable to Add Accessibility Trait to UISegmentedControl
 
 
Q