How do I pass an instance of a class between models in MVVM

I have a working program utilizing the MVVM architecture. There are 3 view models and 3 models. In the first model called I do some testing and would like to pass the result of that testing, a boolean, to the other two models. I have tried to create a class with a boolean, create an instance in the content view and pass it into one of the view models. I would then pass it into the corresponding model. Unfortunately I have been unable to get it to work i.e. pass an instance of the class into the view model. If you see a fix to this approach or have a better approach please let me know. The failure message I get is related to attempting to pass csvData to vooVM. The message is => Cannot use instance member 'csvData' within property initializer; property initializers run before 'self' is available.

My Class that contains the boolean that would be set in the first model and passed to the two other models via their view models:

class CSVData: ObservableObject {
    var updated: Bool = false
}

My Struct Content View initial section:
struct ContentView: View {
    var csvData: CSVData
// The following line gives the above mentioned error message
    @StateObject private var vooVM = VOOVM(csvData: csvData)
    @StateObject private var vfiaxVM = VFIAXVM()
    @StateObject private var prinVM = PrincipalVM()
    @State private var selectedItemID: Int?
    let bottomPadding: CGFloat = 2
    init() {
        self.csvData = CSVData()
    }
    var body: some View {

My View Model initial section:
class VOOVM: ObservableObject {
    var ContainerValues1: [CommonAttributes] = []
    var ContainerValues5: [CommonAttributes] = []
    var MinAndMaxClose1: [String:Double] = [:]
    var MinAndMaxClose5: [String:Double] = [:]
    private var vooModel: VOOModel = VOOModel()
    var symbol: String
    var shares: Double
    
    var csvData: CSVData
    init(csvData: CSVData) {
        self.csvData = csvData
Answered by ChrisMH in 724716022

After some additional research I discovered that the solution is to make a struct instead of a class and utilize a static variable. The Boolean variable updated is now accessible directly in all three models as CSVData.updated. It does not need to be passed in. The struct is shown below.

struct CSVData {
    static var updated: Bool = false
}
Accepted Answer

After some additional research I discovered that the solution is to make a struct instead of a class and utilize a static variable. The Boolean variable updated is now accessible directly in all three models as CSVData.updated. It does not need to be passed in. The struct is shown below.

struct CSVData {
    static var updated: Bool = false
}
How do I pass an instance of a class between models in MVVM
 
 
Q