31.3 Adding the Data Structure
The first step before a list can be displayed is to add the data structure that will form the basis of the user interface. Each row within the list will be represented by an instance of a structure named CarInfo designed to store the following information:
•id – A UUID to uniquely identify each CarInfo instance.
•name – A string value containing the name of the car type, manufacturer or car model.
•image – A string referencing the SF Symbol image to be displayed.
•children – An array of CarInfo objects representing the children of the current CarInfo instance.
Within the project navigator panel, select the ContentView.swift file and modify it to add the CarInfo structure declaration as follows:
import SwiftUI
struct CarInfo: Identifiable {
var id = UUID()
var name: String
var image: String...