where should I put UITableView Data Sources (I am using RxDataSources) when using MVVM-C architecture?
Asked
Active
Viewed 483 times
-2
-
it depends on what you want. It can be an extension of UIViewController, or your custom class which will be allocated in UIViewController, all other vcs must be inherited from super class where your dataSource implemented – Alexandr Kolesnik Dec 05 '19 at 07:50
-
@AlexandrKolesnik What has view controller inheritance got to do with the question? Besides your claim regarding inheritance must be all wrong – Joakim Danielson Dec 05 '19 at 08:05
-
@JoakimDanielson VCSuperClass(contains dataSource) -> InheritedVC(access methods to override properties dataSource basedOn). If using Rx there will be PublishedSubject in superClass which will be changed by viewModel in InheritedVC – Alexandr Kolesnik Dec 05 '19 at 08:30
-
@AlexandrKolesnik Well if this is a requirement for MVVM I will certainly stay away from it. And I don't understand why a data source for a table view must be accessible from a multitude of view controllers. – Joakim Danielson Dec 05 '19 at 11:43
1 Answers
0
If you are using MVVM pattern design. You can put your AnimatableSectionModel
stuff in your ViewModel. And in your viewController observe and bindTo your tableView datasources.

Makaille
- 1,636
- 2
- 24
- 41