Is there a simple way to keep track of depth in deeply nested brackets in SwiftUI views?
For example, in this code from the Missions project, I'm struggling to keep track of which closing brackets are for which views.
NavigationStack {
ScrollView {
LazyVGrid(columns: columns) {
ForEach(missions) { mission in
NavigationLink {
Text("Detail view")
} label: {
VStack {
Image(mission.image)
.resizable()
.scaledToFit()
.frame(width: 100, height: 100)
VStack {
Text(mission.displayName)
.font(.headline)
Text(mission.launchDate ?? "N/A")
.font(.caption)
}
.frame(maxWidth: .infinity)
}
}
}
}
}
.navigationTitle("Moonshot")
}
I have noticed when moving the cursor to one of the brackets, the other will flash yellow, but often the height of the distance between the two brackets is too tall for the editor's view. I'm used to other text editing tools to have collapeable brackets, but I haven't found that feature yet. Thanks for any and all suggestions on making this easier to deal with than getting out a straight edge and holding it up to the screen as I scroll down.
As I go through 100 Days of SwiftUI, I have a feeling I'll learn to keep View types smaller with less nesting, but in the meantime or while working on code before refactoring.