0

On long press gesture on a collectionview cell I want to do some animation on all collectionview cells. How to achieve that? One way is to reload the collectionview. I am just curious is there another way to achieve that?

kidsid49
  • 1,358
  • 3
  • 18
  • 37

1 Answers1

2

Couldn't you use notifications?

In your UICollectionViewCell initialization code:

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(doFancyAnimation:) name:@"MyNotification" object:nil];

And then from your gesture recognizer, post a notification:

[[NSNotificationCenter defaultCenter] postNotificationName:@"MyNotification" object:self];
Peter Heide
  • 519
  • 4
  • 13
  • Yeah sounds great. But i observed only visible cells are caring about the notifications. And while I scroll the animation stops because of reusing of cells :-( – kidsid49 Oct 12 '14 at 05:05