// // ContactResultVC.m // LN_School // // Created by EchoShacolee on 2017/6/28. // Copyright © 2017年 Danson. All rights reserved. // #import "ContactResultVC.h" #import "ContactDetailVC.h" @interface ContactResultVC () @end @implementation ContactResultVC - (void)viewDidLoad { [super viewDidLoad]; self.tableView.tableFooterView = [UIView new]; __weak typeof(self) weakSelf = self; self.reloadBlock = ^{ [weakSelf.tableView reloadData]; }; } - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Dispose of any resources that can be recreated. } #pragma mark - Table view data source - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { return 1; } - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return self.dataSource.count; } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cellID"]; if (!cell) { cell = [[UITableViewCell alloc]initWithStyle:0 reuseIdentifier:@"cellID"]; cell.selectionStyle = UITableViewCellSelectionStyleNone; } if(_dataSource[indexPath.row][0]){ cell.textLabel.text = _dataSource[indexPath.row][0]; }else{ cell.textLabel.text = @""; } return cell; } -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{ if (self.pushBlock) { self.pushBlock(_dataSource[indexPath.row]); } } -(void)scrollViewWillBeginDragging:(UIScrollView *)scrollView{ if (self.scrollBlock) { self.scrollBlock(); } } @end