1

Current situation: I have implemented drag-and-drop functionality feature where users can drag items from one place and drop on any allowed row in UITableView. For example, users can drag item and dropped only on first cell or first 3 cells. Other cells are invalid. This is working fine.

Question: With my implementation users are confused about where to drop item. I want to blink or highlight all cells where users can drop an item on demand(I mean first 3 cells would start blinking or highlighted when user has item to drop). In short is there anyway I can manually blink multiple cells whenever required and reset them to their original state later on.

Abizern
  • 146,289
  • 39
  • 203
  • 257
Paresh Masani
  • 7,474
  • 12
  • 73
  • 139
  • You can use some code which will make the table cell to blink. Something like this http://stackoverflow.com/questions/7820232/blink-hidden-and-using-blocks – iDev Feb 04 '13 at 23:13
  • Thanks @ACB! I have done highlighting cells by adding coloured UIView with alpha 0.4 on required cell.ContentView and it looks good. Also used timer to switch this alpha 0 <-> 0.4 @ every second and it worked but the link you posted should be the way to implement blink. Thanks again. Please post that link as an answer. – Paresh Masani Feb 05 '13 at 10:09

1 Answers1

1

I would suggest you to implement a blinking effect to the cell or its contentView in this case. In an animation block, you need to switch the alpha using a timer. You can get a sample code from this question which you can modify to put it in a timer and to apply on your cell.

[UIView transitionWithView:cell.contentView
       duration:0.6f
       options:UIViewAnimationOptionCurveEaseInOut | UIViewAnimationOptionRepeat | UIViewAnimationOptionAutoreverse
       animations:^{ cell.contentView.layer.alpha = 0.4f; }
       completion:NULL];
Community
  • 1
  • 1
iDev
  • 23,310
  • 7
  • 60
  • 85