I would like to perform some assignments to some global variables when a change is made to an @Published item in an ObservableObject.
I have multiple @Published variables in my ObservableObject. Is there a way to adjust all the @Published variables in an ObservableObject when only one @Published variable is modified by a view external to the ObservableObject?
This is basically the code I want to do:
class myObsObj: ObservableObject{
@Published var variable1 = 2.1
@Published var variable2 = 7.1
When variable1 is changed, set variable2 = 5 + variable1
}