Reputation: 1421
I have a rather complex view that calls to a few sub views and in order to make it more accessible I would like to create an AccessibilityRotor so you can easily get to the different portions of the view, however I have tried a bunch of different ways of writing the code and no matter what I try, it will not swipe to the different sections.
Here's an example of the main parent view's layout where I am trying to make the rotor work:
struct MyView: View {
@Namespace private var myNamespace
var body: some View {
NavigationStack(path: $myPath) {
ZStack {
Color(.black)
.ignoresSafeArea()
VStack(spacing: 0) {
Spacer()
ZStack {
GroupBox {
VStack(spacing: 0) {
SubView1()
.accessibilityRotorEntry(id: "FirstSubView", in: myNamespace)
SubView2()
.accessibilityRotorEntry(id: "SecondSubView", in: myNamespace)
}
MainView()
.accessibilityRotorEntry(id: "MainView", in: myNamespace)
FooterView()
.accessibilityRotorEntry(id: "FooterView", in: myNamespace)
}
.groupBoxStyle(MyGroupStyle())
}
}
}
}
.accessibilityRotor("Test Rotor") {
AccessibilityRotorEntry("First View", id: "FirstSubView", in: myNamespace)
AccessibilityRotorEntry("Second View", id: "SecondSubView", in: myNamespace)
AccessibilityRotorEntry("Main View", id: "MainView", in: myNamespace)
AccessibilityRotorEntry("Footer View", id: "FooterView", in: myNamespace)
}
}
}
Each of these other views also have fairly complex layouts, and the goal is to allow the user to use the rotor to swipe to the different sections of the view and then tap on whatever section they want to access. From there I will implement other accessibility options, allowing them to navigate those views.
Currently, I start at SubView1, access the rotor, swipe up/down and I cannot swipe to the next section. There is little meaningful documentation on AccessibilityRotor so I'm hoping someone knows how to solve this.
Upvotes: 0
Views: 49