ASPointDetailTableView.m 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. //
  2. // ASPointDetailTableView.m
  3. // Asteria
  4. //
  5. // Created by iOS on 2023/6/24.
  6. //
  7. #import "ASPointDetailTableView.h"
  8. #import "ASPointDetailCell.h"
  9. @interface ASPointDetailTableView ()<UITableViewDelegate,UITableViewDataSource>
  10. @end
  11. @implementation ASPointDetailTableView
  12. - (instancetype)initWithFrame:(CGRect)frame style:(UITableViewStyle)style {
  13. self = [super initWithFrame:frame style:style];
  14. if (self) {
  15. [self configSelf];
  16. }
  17. return self;
  18. }
  19. - (void)configSelf {
  20. [self baseSet];
  21. [self registerClass:[ASPointDetailCell class] forCellReuseIdentifier:@"ASPointDetailCell"];
  22. self.delegate = self;
  23. self.dataSource = self;
  24. self.alwaysBounceVertical = true;
  25. self.showsVerticalScrollIndicator = false;
  26. }
  27. // MARK: - delegate,datasource
  28. - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
  29. return self.dataArr.count;
  30. }
  31. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
  32. ASPointDetailCell *cell = [tableView dequeueReusableCellWithIdentifier:@"ASPointDetailCell" forIndexPath:indexPath];
  33. if (self.dataArr.count <= indexPath.row) {
  34. return cell;
  35. }
  36. ASPointDetailModel *m = self.dataArr[indexPath.row];
  37. [cell setData:m];
  38. return cell;
  39. }
  40. @end