I'm using the UIView-Glow category trying to highlight certain UITableViewCells. But it doesn't work if it's used in tableView:cellForRowAtIndexPath:. I guess it must be used after the certain view appeared on the screen. So, is there a possibility to let certain UITableViewCells glow (even when scrolling the table view)?
Asked
Active
Viewed 293 times
1 Answers
0
Yes, there is possibility to let certain UITableViewCells glow with the category file you mentioned. You need to call the category methods in the table view delegate willDisplayCell instead of cellForRowAtIndexPath.
For example:
- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath
{
[cell startGlowing];
}

Valent Richie
- 5,226
- 1
- 20
- 21
-
Thank you, that was exactly the method I was looking for. Still one problem remains: If I reload the tableView the cells get re-used. This results in glows of the wrong cells. It seems that `[cell stopGlowing]` doesn't always show the desired effect when cells get re-used. – Norbert Jun 03 '13 at 11:23
-
@Norbert have you put the conditional in the willDisplayCell? – Valent Richie Jun 03 '13 at 11:34
-
I think so, yes: `if (letItGlow) { [cell startGlowingWithColor:[UIColor redColor] intensity:0.3f]; } else { [cell stopGlowing]; }` – Norbert Jun 03 '13 at 12:18
-
@Norbert you might need to put further checking whether the view is glowing, e.g. `if [cell glowView]`, in the first place before calling stopGlowing. – Valent Richie Jun 03 '13 at 12:51
-
Unfortunately, this didn't work either: `...else if([cell glowView]) { [cell stopGlowing]; }` See this [Screenshot](http://img823.imageshack.us/img823/914/bildschirmfoto20130603u.png) – Norbert Jun 03 '13 at 15:56