How to Enable Group Navigation Behavior for Custom Views in VoiceOver?

In VoiceOver, when using Group Navigation style, the cursor first focuses on the semantic group. To navigate inside the group, a two-finger swipe (left or right) can be used. This behavior works for default containers like the Navigation Bar, Tab Bar, and Tool Bar.

How can I achieve the same behavior for a custom view?

I tried setting accessibilityContainerType = .semanticGroup, but it only works for Mac Catalyst. Is there an equivalent approach for iOS?

How to Enable Group Navigation Behavior for Custom Views in VoiceOver?
 
 
Q