5

我有一个 VIPER 模块 ( SubjectList),我想在其中有一个更通用HeaderModule的,带有 aSubjectListCollectionModule和 a BlockModule。在什么时候我会在逻辑上添加HeaderModule

我可以在 中包含模块SubjectListViewModel,但我也可以在 中呈现它们,SubjectListView通过 Interface Builder 实例化它们,使用xibs. 推荐什么?

4

2 回答 2

2

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.

于 2018-02-20T13:05:16.630 回答
1

使用 xib 是一个不错的选择,但我建议您使用 Interface Builder。这对 VIPER 来说将是一件更好的事情。

于 2018-02-21T09:44:17.723 回答