In order to update a view, I want to forward the view from my ViewController to the ViewModel by forwarding it.
Something like the following:
viewModel.labelViewModel.subscribe(forward: labelView) { labelView, model in labelView.update(with: model) }
but using Combine.
So how can I return the observer with the observable?
In the ViewController I'm trying:
viewModel.$labelModel.sink { lab in
print("Value: \(lab?.1.text)")
}.store(in: &subscriptions)
with the label in the ViewModel:
@Published private(set) var labelModel: (Label, Label.Model)?
but what I want to do is actually return the same label in the sink as is subscribing from the ViewController.
Is this possible?