Mohammad Azam
1 min readAug 19, 2022

--

Hi,

Sorry I did not understand your comment. I am not doing MVVM. Actually, the whole article is saying that don't use MVVM in SwiftUI unless you have a special use case. I have removed the VM from the picture and displaying models right into the View (View is the View Model). The Store here is serving as a webservice but if your app is complicated and responsible for combining a lot of results then you can use Store as a middle layer and create a separate Webservice layer.

As for testing, you should definitely write domain level unit tests. After that I will write end to end test with a real (TEST) API endpoint to make sure that the application works as expected.

I do not use mocks for testing webservice. I would rather just test the webservice in an end to end test with a TEST API which is very close to production.

--

--

Mohammad Azam
Mohammad Azam

Written by Mohammad Azam

Lead instructor at a coding bootcamp. Top iOS mobile instructor on Udemy. Author of multiple books and international speaker. azamsharp.school

No responses yet