RAHomeViewController+HomeTableDelegate.m 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. //
  2. // RAHomeViewController+HomeTableDelegate.m
  3. // Apex And Drivers
  4. //
  5. // Created by Jack on 2018/6/1.
  6. // Copyright © 2018年 USAI. All rights reserved.
  7. //
  8. #import "RAHomeViewController+HomeTableDelegate.h"
  9. #import "RAHomeOrderModel.h"
  10. @implementation RAHomeViewController (HomeTableDelegate)
  11. - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
  12. return 110.0f;
  13. }
  14. - (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
  15. UIView *header = [[UIView alloc] initWithFrame:CGRectMake(0, 0, CGRectGetWidth(tableView.bounds), 44.0f)];
  16. header.backgroundColor = [UIColor lightGrayColor];
  17. UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(10, 11, CGRectGetWidth(tableView.bounds) - 20, 22)];
  18. [header addSubview:label];
  19. label.text = [self titleForSection:section];
  20. return header;
  21. }
  22. - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
  23. return 44.f;
  24. }
  25. - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
  26. RAHomeOrderModel *order = [self orderModelForIndexPath:indexPath];
  27. [self pushDetailViewControllerForModel:order];
  28. }
  29. @end