在 UICollectionViewCell 上双击手势? [英] Double tap Gesture on UICollectionViewCell?

查看:43
本文介绍了在 UICollectionViewCell 上双击手势?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想双击 UICollectionViewCell 以喜欢该个人资料,就像 OkCupid App 一样.我已经在集合视图上应用了点击手势,但它不起作用.

I want to double tap on the UICollectionViewCell to like the profile just like OkCupid App. I have applied Tap Gesture on Collection View but it does not work.

当我每次尝试双击单元格时 didSelectCollectionViewCell 方法调用.

When I try to double tap the cell every time didSelectCollectionViewCell Method call.

推荐答案

您得到的错误:无法调用非函数类型 'UICollectionView!' 的值是因为你尝试使用了错误的方法.

The error which you got: Cannot call value of non-function type 'UICollectionView!' is because you have try to use wrong method.

请尝试使用这个:

var selectedIndexPath: NSIndexPath = self.collectionView.indexPathForItemAtPoint(pointInCollectionView)

这篇关于在 UICollectionViewCell 上双击手势?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆