RDSSystemSetVC.m 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. //
  2. // RDSSystemSetVC.m
  3. // Temperature
  4. //
  5. // Created by RD on 2023/1/16.
  6. //
  7. #import "RDSSystemSetVC.h"
  8. #import "RDSSystemSetCell.h"
  9. #import "RDSUserProtocolViewController.h"
  10. #import "RDCheckAppVersion.h"
  11. static NSString * const RDSSystemSetCellID = @"RDSSystemSetCell";
  12. @interface RDSSystemSetVC ()<UITableViewDelegate , UITableViewDataSource>
  13. @property (nonatomic, weak) UITableView *tableView;
  14. @end
  15. @implementation RDSSystemSetVC
  16. - (void)viewDidLoad {
  17. [super viewDidLoad];
  18. // Do any additional setup after loading the view.
  19. self.title = @"系统设置";
  20. self.view.backgroundColor = UIColor.whiteColor;
  21. [self p_setupTableView];
  22. }
  23. - (void)p_setupTableView {
  24. UITableView *tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 10, SCREEN_WIDTH, SCREEN_HEIGHT-20-60)];
  25. [self.view addSubview:tableView];
  26. tableView.dataSource = self;
  27. tableView.delegate = self;
  28. tableView.contentInset = UIEdgeInsetsMake(0, 0, 0, 0);
  29. self.tableView = tableView;
  30. self.tableView.backgroundColor = [UIColor clearColor];
  31. [self.tableView registerNib:[UINib nibWithNibName:@"RDSSystemSetCell" bundle:nil] forCellReuseIdentifier:RDSSystemSetCellID];
  32. self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
  33. self.tableView.showsVerticalScrollIndicator = NO;
  34. tableView.rowHeight = 60*kSCALE_WIDTH_X;
  35. }
  36. #pragma mark - Table view data source
  37. - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
  38. return 1;
  39. }
  40. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
  41. RDSSystemSetCell *cell = [tableView dequeueReusableCellWithIdentifier:RDSSystemSetCellID];
  42. cell.selectionStyle = UITableViewCellSelectionStyleNone;
  43. if(indexPath.row == 0){
  44. cell.titleLab.text = @"检查更新";
  45. }
  46. return cell;
  47. }
  48. - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
  49. [tableView deselectRowAtIndexPath:indexPath animated:YES];
  50. int row = (int)indexPath.row;
  51. [TheCheckAppVersion checkUpdateAlert];
  52. // RDSUserProtocolViewController *userProtocolVC = [[RDSUserProtocolViewController alloc] init];
  53. // userProtocolVC.url = row == 0 ? kUserAgreement:kPrivacyPolicy;
  54. // userProtocolVC.vcTitle = row == 0 ? @"用户协议":@"隐私政策";
  55. // [self pushViewController:userProtocolVC animated:YES];
  56. }
  57. @end