You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How you pass values from view to another view in needle? In your examples you use dependency ViewModel, but what if I need to pass some value to init ViewModel? How to do that?
The text was updated successfully, but these errors were encountered:
struct AddressesView<ViewModel>: View where ViewModel: AddressesViewModelProtocol {
@ObservedObject var viewModel: ViewModel
var detailBuilder: AddressDetailBuilder
var body: some View {
NavigationView {
List(viewModel.addresses) { address in
NavigationLink(destination: detailBuilder.addressDetailView) {
AddressRow(address: address)
}
}
.navigationTitle("Address List")
}
}
}
Maybe it is meant like this.
How would you pass the selected address down the line here to AddressDetailView ?
Of course you can keep it somewhere globally or in shared instances, but for cases like this it seems to be a bit over the top.
So is there any way to pass values ?
How you pass values from view to another view in needle? In your examples you use dependency ViewModel, but what if I need to pass some value to init ViewModel? How to do that?
The text was updated successfully, but these errors were encountered: