RQLearningMaterialsViewController.m 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. //
  2. // RQLearningMaterialsViewController.m
  3. // SDJK
  4. //
  5. // Created by 张嵘 on 2022/6/30.
  6. //
  7. #import "RQLearningMaterialsViewController.h"
  8. @interface RQLearningMaterialsViewController ()
  9. /// viewModel
  10. @property (nonatomic, readonly, strong) RQLearningMaterialsViewModel *viewModel;
  11. @end
  12. @implementation RQLearningMaterialsViewController
  13. @dynamic viewModel;
  14. #pragma mark - SystemMethod
  15. - (void)viewDidLoad {
  16. [super viewDidLoad];
  17. // Do any additional setup after loading the view.
  18. }
  19. #pragma mark - OverrideMethods
  20. - (UITableViewCell *)tableView:(UITableView *)tableView dequeueReusableCellWithIdentifier:(NSString *)identifier forIndexPath:(NSIndexPath *)indexPath {
  21. RQCommonGroupViewModel *groupViewModel = self.viewModel.dataSource[indexPath.section];
  22. RQCommonItemViewModel *itemViewModel = groupViewModel.itemViewModels[indexPath.row];
  23. return [NSClassFromString(itemViewModel.itemClassName) cellWithTableView:tableView];
  24. }
  25. - (void)configureCell:(RQCommonCell *)cell atIndexPath:(NSIndexPath *)indexPath withObject:(id)object {
  26. [cell bindViewModel:object];
  27. }
  28. @end