Open suho opened 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()
Issue
I found that API calls (Manager calls) are inconsistent between modules. For instance:
UserManager.shared.loginUser
is called inLoginViewController
(ref)UserManager.shared.logout
is called inMenuViewController
(ref)UserManager.shared.refreshAccessToken
is called inLoginViewModel
(ref)SurveyManager.shared.fetchSurveys
is called inHomeViewModel
(ref)Could you share with me more details about why you use it in different places (
ViewController
vsViewModel
)?