Guru
Guru

Reputation: 5363

iPhone UITableViewCell SwipeGesture

I wanted to simply animate custom view in a custom table cell by swiping left or right in that cell. I am loading the cell from the xib.

This is the code I used to populate the cell from the xib.

- (UITableViewCell *)tableView:(UITableView *)tableView
     cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"CellIdentifier";

CustomCell *CustomCell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];

if (CustomCell == nil)
{
    NSArray *cells =[[NSBundle mainBundle] loadNibNamed:@"CustomCell" owner:nil options:nil];

    for (UIView *view in cells)
    {
        if([view isKindOfClass:[UITableViewCell class]])
        {
            CustomCell = (CustomCell *)view;
            break;
        }
    }

}
CustomCell.textLabel.Text = @"this is a text";
return CustomCell;
}

What I need is to swipe a cell to reveal a background view with buttons. I have searched and find many tutorials regarding this but none of the same is using the custom cell with xib.

Upvotes: 2

Views: 156

Answers (2)

SAMIR RATHOD
SAMIR RATHOD

Reputation: 3510

hi try this for your requirement of swipe a cell to reveal a background view with buttons.

jzswipecell

Upvotes: 1

Mansi Panchal
Mansi Panchal

Reputation: 2357

Check out this project

UITableViewCell Swipe

Upvotes: 1

Related Questions