tailec / ios-architecture

A collection of iOS architectures - MVC, MVVM, MVVM+RxSwift, VIPER, RIBs and many others
MIT License
1.5k stars 188 forks source link

Code clean up #2

Closed amadeu01 closed 5 years ago

amadeu01 commented 5 years ago

I removed the reposViewModel variable from:

Delegate methods

amadeu01 commented 5 years ago

@tailec this implementation of the MVVM is really close to the MVP. I cannot tell the difference between this implementation and MVP.

tailec commented 5 years ago

I've added self to delegate methods because I was following apple delegation pattern like: func tableView(UITableView, didSelectRowAt: IndexPath) Found some explanation there https://developer.apple.com/library/archive/documentation/General/Conceptual/DevPedia-CocoaCore/Delegation.html

About MVP: I think in MVP, presenter can have access to view (imports UIKit) but view models in MVVM are forbidden to do that.

amadeu01 commented 5 years ago

MVP just create a layer of abstraction to the view. So, the view communicate to the presenter by the protocol. But, the presenter should not have references to the UIKit. The ideia is to be able to test the view without a device (simulator). Like run the tests on macOS

amadeu01 commented 5 years ago

I'm gonna close it