1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- //
- // 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
|