Button事件不会在UICollectionViewCell上引发选定的事件

时间:2014-01-24 11:46:05

标签: ios objective-c storyboard xcode5 uicollectionview

我有一个UICollectionView,我使用UICollectionViewDelegate方法didSelectItemAtIndexPath / didDeselectItemAtIndexPath处理单元格的点击。

问题是我在单元格中添加了一些按钮,它们不会激活select / deselect方法。

我实际上已经用一个复杂的解决方案修复了这个问题(我将我的按钮事件委托给collectionviewcontroller并维护我自己的选定单元格列表),但它很复杂,我觉得它可以重构为它简单得多。

有关如何点击UICollectionViewCell上的按钮并仍在didSelectItemAtIndexPath上触发didDeselectItemAtIndexPath / collectionviewcontroller个方法的任何想法?

0 个答案:

没有答案