| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- //
- // MOShareFriendListTableView.m
- // MiMoLive
- //
- // Created by SuperC on 2023/11/20.
- //
- #import "MOShareFriendListTableView.h"
- @interface MOShareFriendListTableView () <UITableViewDelegate,UITableViewDataSource>
- @end
- @implementation MOShareFriendListTableView
- - (instancetype)initWithFrame:(CGRect)frame style:(UITableViewStyle)style
- {
- self = [super initWithFrame:frame style:style];
- if (self)
- {
- self.delegate = self;
- self.dataSource = self;
- [self registerClass:[MOSelectMemberListCell class] forCellReuseIdentifier:MOSelectMemberListCell_ID];
- }
- return self;
- }
- - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
- {
- return 1;
- }
- - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
- {
- return self.dataArr.count;
- }
- - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
-
- MOPersonList *model = self.dataArr[indexPath.row];
- MOSelectMemberListCell *cell = [tableView dequeueReusableCellWithIdentifier:MOSelectMemberListCell_ID];
- if (cell == nil){
- cell = [[MOSelectMemberListCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:MOSelectMemberListCell_ID];
- }
- cell.model = model;
- return cell;
- }
- - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
- {
- return 76.0;
- }
- - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
- {
- [tableView deselectRowAtIndexPath:indexPath animated:YES];
- MOPersonList *model = self.dataArr[indexPath.row];
-
- model.isChoose = !model.isChoose;
- [self reloadRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationNone];
-
- self.cellClickBlock ? self.cellClickBlock(model) : nil;
- }
- - (NSMutableArray *)dataArr{
- if(!_dataArr){
- _dataArr = [NSMutableArray array];
- }
- return _dataArr;
- }
- @end
|