Touch events on UICollectionView causing delegate methods to not be called

青春壹個敷衍的年華 提交于 2020-01-14 04:05:12

问题


I have a UICollectionView set up in which I have cells. I want to tap these cells to play a sound, and also have the ability to drag these cells into a different view to drop those sounds in.

To play sounds, I use the -collectionView:collectionView didSelectItemAtIndexPath method. And to implement the drag functionality, I used custom login in the touchesBegan, touchesMoved etc. methods.

However, if I have the methods touchesBegan, touchesMoved, the UICollectionView delegate methods never get called. Is there a way I can delay the touch events being delivered until the delegate methods have failed? Or if I use touch events, do I have to implement custom logic to detect a tap on cell too?

来源:https://stackoverflow.com/questions/21329277/touch-events-on-uicollectionview-causing-delegate-methods-to-not-be-called

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!