Note that there are some explanatory texts on larger screens.

plurals
  1. POUITableViewCell refresh issue after editing mode
    text
    copied!<p>I have implemented a subclass of <code>UITableViewCell</code> called <code>UITableViewCellCustom</code>. When entering in editing mode or when I swipe the cell to display the delete button I want to hide a label from my cell and display it when exiting the editing mode.</p> <p>I have implemented the following code in the <code>UITableViewCellCustom</code></p> <pre><code>- (void)willTransitionToState:(UITableViewCellStateMask)state { [super willTransitionToState:state]; if ((state == UITableViewCellStateShowingDeleteConfirmationMask) || (state == UITableViewCellStateShowingEditControlMask)) { [UIView animateWithDuration:0.5 animations:^{rankLabel.alpha = 0.0;}]; } } - (void)didTransitionToState:(UITableViewCellStateMask)state { [super didTransitionToState:state]; if (state == UITableViewCellStateDefaultMask) { [UIView animateWithDuration:0.5 animations:^{rankLabel.alpha = 1.0;}]; } } </code></pre> <p>I have two issues.</p> <ol> <li><p>For example if I have 23 rows in my tableview. When my first 5 rows are displayed I enter to the edit mode. My rankLabel is hidden and then I'm scrolling to the bottom of my table (to row 23) and I'm exiting from the edit mode. The rankLabel is displayed again but not for all cells, my cells 6 / 12 and 18 are not refreshed correctly. Any idea?</p></li> <li><p>In method <code>willTransitionToState</code> I'm using <code>animateWithDuration</code> to hide softly my rankLabel but it doesn't work, the rankLabel is hidden but without transition. The same method works very well in <code>didTransitionToState</code> when I want to show again the label. Any idea?</p></li> </ol> <p>Thanks for your support.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload