I have an app with MVVM and I don't know where implement networking calls. In ViewModel, in Controller? Another pattern to implement networking?
I think ViewModel is the best place but I'm not totally sure
Something like this
// Your network calls
class NetworkQuery {
}
class NetworkCommand {
}
// Service (Facade pattern)
class NetworkServices {
let networkQuery: NetworkQuery!
let networkCommand: NetworkCommand!
}
// Your controller or view model, you can place them in either both
class MyControllerOrViewModel {
let networkServices: NetworkServices!
}
Just now two cents' worth..
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With