I want to focus on the first Button A
of the bottom Hstack
when the user navigates downwards. How can I achieve that?
As of now, the guide is picking the nearest element.
Code:
import SwiftUI
struct DummyView: View {
@Environment(\.presentationMode) var presentationMode
var body: some View {
contentView
parent
}
private var parent: some View {
VStack {
if #available(tvOS 15.0, *) {
HStack {
Spacer()
Button ("1") {}
Button ("2") {}
Button ("3") {}
Spacer()
}
.focusSection()
.border(Color.white, width: 2)
} else {
// Fallback on earlier versions
}
Spacer()
if #available(tvOS 15.0, *) {
HStack {
Button ("A") {}
Spacer()
Button ("B") {}
Spacer()
Button ("C") {}
}
.border(Color.white, width: 2)
.focusSection()
} else {
// Fallback on earlier versions
}
}
}
private var contentView: some View {
VStack {
Spacer()
Text("THIS IS DUMMY SCREEN")
Spacer()
}
}
}