UICollectionViewCell Shake

后端 未结 5 812
谎友^
谎友^ 2020-12-13 19:00

I have created a UICollectionView and would like to have all the cells shake like the edit mode of the springboard on the iPhone. I have created my shake code but don\'t kno

5条回答
  •  执笔经年
    2020-12-13 19:45

    If you put you're code in a method called startJiggling in your custom cell, then you could call this method in your controller:

    [self.collectionView.visibleCells makeObjectsPerformSelector:@selector(startJiggling)];

    That ensures that all visible cells will start jiggling.

    Then I'd also set some flag indicating that your cells should jiggle and test for that in collectionView:cellForItemAtIndexPath:. If YES, then call your method.

提交回复
热议问题