Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VIPER architecture: submodules in a module

I have a VIPER module (SubjectList) in which I want to have a more generic HeaderModule, with a SubjectListCollectionModule and a BlockModule. At what point would I logically add the HeaderModule?

I could include the modules in the SubjectListViewModel, but I could also render them in the SubjectListView, instantiate them via Interface Builder, use xibs. What is recommended?

like image 733
jbehrens94 Avatar asked Oct 17 '22 22:10

jbehrens94


2 Answers

I recently made a sample project which is built using the VIPER architecture with the help of the codegen tool called Generamba.

Here is the project: https://github.com/dimklo/ViperSample

In this project you can find the module called News. This module has two submodules named NewsTable and NewsFilter. These submodules are presented from the News module router in methods presentNewsFilterModule and presentNewsListModule.

The submodule creation code there is not very easy to follow but maybe it will help you somehow.

like image 187
Dmitry Klochkov Avatar answered Oct 21 '22 08:10

Dmitry Klochkov


Use of xib is a good option, but I suggest you go with Interface Builder. That'll be a more well-to-do thing with VIPER.

like image 22
rxtr007 Avatar answered Oct 21 '22 07:10

rxtr007