2015-02-08 81 views
0

我在CollectionView上有一个按钮,用于为CollectionView上的标签设置动画(将它们向前滑动回&)。我想知道是否可以使用相同的按钮为单元格上的标签制作动画。iOS Swift:从CollectionView上的按钮动画CollectionViewCell元素

我正在考虑将collectionView:performAction作为一种可能的解决方案,但是我想在获取一些可能无法解决的问题之前花费太多时间来获得其他一些想法。

回答

1

宾果:

for item in self.collectionView!.visibleCells() as [UICollectionViewCell] { 
     var indexpath : NSIndexPath = self.collectionView!.indexPathForCell(item as CollectionViewCell)! 
     var cell : CollectionViewCell = self.collectionView!.cellForItemAtIndexPath(indexpath) as CollectionViewCell 

     //access cell data 
     println(cell.labelName.text) 
    } 

发现here