Reputation: 5363
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
Reputation: 3510
hi try this for your requirement of swipe a cell to reveal a background view with buttons.
Upvotes: 1