Change state from other struct

I have this code:

    static var viewModels = [RestaurantListViewModel]() {

        didSet {

            dataSet = true

            print("data set")

        }

    }

When it didSet is called, I want it to change a state in another struct, how can I accomplish this?

Answered by Mcrich23 in 686810022

Decided to set this in the same struct and then pass it in as a parameter.

Can you provide a bit more information about how your code is structured? This should be possible, either through didSet or some other way.

Accepted Answer

Decided to set this in the same struct and then pass it in as a parameter.

Change state from other struct
 
 
Q