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?
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With