FortechRomania / ios-mvp-clean-architecture

Demo iOS application built to highlight MVP (Model View Presenter) and Clean Architecture concepts

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

architecture problem

johanntony opened this issue · comments

commented

if there is a btn on cell. when i press the btn, how to deal with it ,if use this architecture. i am confuse about it.

Hi @johanntony,

I would suggest that the main presenter would have a list of cell presenters and when a button is tapped on the cell, the cell calls the corresponding method on the cell presenter.

Once this is done, you have two options:

  1. Have the cell presenter call a method on the main presenter (via the delegation pattern) or
  2. Have the cell presenter do the actual work by calling directly into the use case

Regards,
Cosmin

commented

Hi @johanntony,

I would suggest that the main presenter would have a list of cell presenters and when a button is tapped on the cell, the cell calls the corresponding method on the cell presenter.

Once this is done, you have two options:

  1. Have the cell presenter call a method on the main presenter (via the delegation pattern) or
  2. Have the cell presenter do the actual work by calling directly into the use case

Regards,
Cosmin

Excellent ! guy!

I am closing this as it seems to be resolved.