如何给uicollectionviewcell添加长按手势

2025-05-12 06:37:22
推荐回答(1个)
回答1:

1.创建集合试图,这个就比较简单了.创建完集合试图,我们在集合试图上面添加长按的手势
UIGestureRecognizerDelegate 先遵从协议
longPressGr =
=

=
=
2.我们在longpressToDo里面添加方法-(
)longPressToDo:(UILongPressGestureRecognizer *

(gestureRecognizer.state !=

=
*indexPath =

(indexPath ==

UICollectionViewCell* cell =