How can I change the UIButtons I have in UITableViewCells

Ok I have a UIButton inside each row of the UITableView and I want it to fade out to alpha 0 when it starts editing. Then vice versa, when it returns to normal. How to do it?

I know what methods to use, but how do I access the buttons from outside tableViewcellForRowAtIndex :?

+2


a source to share


1 answer


Well, actually, you can just call cellForRowAtIndexPath:

to traverse the path of the pointer you get and get the cell, then get the button inside the cell and voila!



- (void)tableView:(UITableView *)tableView willBeginEditingRowAtIndexPath:(NSIndexPath *)indexPath {
   UITableViewCell *cell = [ tableView cellForRowAtIndexPath: indexPath ];
   UIButton *button = [ cell.contentView.subviews objectAtIndex: ... ];
   ...
}

      

+1


a source







All Articles