tquocit / survey-demo

0 stars 0 forks source link

[Question] MVVM architectural pattern usage #5

Open suho opened 6 months ago

suho commented 6 months ago

Issue

I found that API calls (Manager calls) are inconsistent between modules. For instance:

Could you share with me more details about why you use it in different places (ViewController vs ViewModel)?

tquocit commented 6 months ago

These are my mistakes. Follow the MVVM, the login should separate with View. Should move these actions into ViewModel In LoginViewModel, we can create methods in ViewModel such as: loginUser() in LoginViewModel and logoutUser() in MenuViewModel()