Skip to content

Latest commit

 

History

History
35 lines (30 loc) · 928 Bytes

File metadata and controls

35 lines (30 loc) · 928 Bytes

Loading effect for Table view cell

alt sample

Cell has:

  • animation duration
  • complition block
  • failure block

cellForRowAtIndexPath method look like this

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    GMLoadingTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:[GMLoadingTableViewCell cellIdentifier]];
    cell.label.text = @"Cell text"
    cell.animationDuration = 2;
    cell.completionBlock = ^{
        NSLog(@"Done!");
    };
    cell.failureBlock = ^{
      NSLog(@"Fail!");
    };
    return cell;
}

Important

- (NSIndexPath *)tableView:(UITableView *)tableView willSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    return nil;
}

- (NSIndexPath *)tableView:(UITableView *)tableView willDeselectRowAtIndexPath:(NSIndexPath *)indexPath {
    return nil;
}