// // diskListTableView.m // 隐私保护 // // Created by xd h on 2024/1/23. // #import "diskListTableView.h" #import "diskListTableCell.h" @interface diskListTableView() @end @implementation diskListTableView #pragma mark - init - (instancetype)init { self = [super init]; if (self) { [self initCommon]; } return self; } - (instancetype)initWithCoder:(NSCoder *)coder { self = [super initWithCoder:coder]; if (self) { [self initCommon]; } return self; } - (id)initWithFrame:(CGRect)frame { self = [super initWithFrame:frame]; if (self) { [self initCommon]; } return self; } - (void)initCommon { self.delegate = self; self.dataSource = self; self.separatorStyle = UITableViewCellSeparatorStyleNone; self.backgroundColor = [UIColor colorWithRed:235.0/255.0 green:235.0/255.0 blue:235.0/255.0 alpha:1.0]; } #pragma mark - uitableviewDelegate - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *cellIdentifer = @"diskListTableCell"; diskListTableCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifer forIndexPath:indexPath]; if(cell == nil){ cell = [[diskListTableCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifer]; } return cell; } - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return 1; } - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { return 60.0; } - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { [tableView deselectRowAtIndexPath:indexPath animated:YES]; } @end