How to get touch outside current cell in iOS ?(swift)

穿精又带淫゛_ 提交于 2019-12-12 02:45:47

问题


I am creating a custom SwipeableCell to left/right. I want to detect touch outside of current cell to return it to default state. How can I do that?

Picture of my program

I know how to return cell to default state, but I don't know how to detect touch.


回答1:


Lets save the current NSIndexPath on the viewController, when you swipe on it to some variable.

In didSelectCellForRow, if the saved indexPath is not equal with the indexPath coming in, than lets restore the state of cell at the saved indexPath.



来源:https://stackoverflow.com/questions/33210340/how-to-get-touch-outside-current-cell-in-ios-swift

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