31.7 Using OutlineGroup
Now that we’ve seen the use of the List view to display hierarchical data, the project will be modified to make use of the OutlineGroup view within a list to divide the list into groups, each with a section header.
Once again working within the ContentView.swift file, modify the ContentView declaration so that it reads as follows:
struct ContentView: View {
var body: some View {
List {
ForEach(carItems) { carItem in
Section(header: Text(carItem.name)) {
OutlineGroup(carItem.children ?? [CarInfo](),
...