Why View calls showGreeting, but not something like a delegate method showGreetingButtonTapped?
Dmitry Povolotsky
41
In the examples the View directly owns the Presenter/ViewModel which conforms to corresponding protocols, thus we can be more explicit. Alternatively we could define the ViewEventHandler protocol with didTapButton function and make the Presenter/ViewModel confirming to it, that would work for the MVP. Although in case of MVVM that would mean that the ViewModel will have to know about the View, since we should do .didTapButton(button). I’d personally prefer to skip delegation because the View usually owns the Presenter/ViewModel (strong relationship) and delegation implies weak referencing.