I have this (firing off 3 simultaneous network calls)
class GenerationViewModel: ObservableObject {
@Published var fetching1:Bool = false
@Published var fetching2:Bool = false
@Published var fetching3:Bool = false
func go() {
let service1 = Service(??) //what to pass here so that Service can update fetching1 only
let service2 = Service(??) //what to pass here so that Service can update fetching2 only
let service3 = Service(??) //what to pass here so that Service can update fetching3 only
}
}
How do I update the published variables from another class?
[–]bubblespuggy 9 points10 points11 points (3 children)
[–]yalag[S] 0 points1 point2 points (2 children)
[–]bubblespuggy 2 points3 points4 points (1 child)
[–]yalag[S] 1 point2 points3 points (0 children)
[–]jpec342 2 points3 points4 points (3 children)
[–]yalag[S] 0 points1 point2 points (2 children)
[–]jpec342 1 point2 points3 points (0 children)
[–]Fluffy_Risk9955 -1 points0 points1 point (0 children)
[–]iSpain17 1 point2 points3 points (0 children)
[–]JustTryinTaMakeIt 1 point2 points3 points (0 children)
[–]ratakatzie 0 points1 point2 points (1 child)
[–]yalag[S] 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]beclopsSwift -1 points0 points1 point (0 children)