Selector to get indexPath UICollectionView Swift 3.0

后端 未结 5 1525
北恋
北恋 2020-12-21 16:02

I\'m trying to get indexPath on the cell when it is tapped twice. I\'m passing arguments in Selector like this but it is giving error. What is the

5条回答
  •  春和景丽
    2020-12-21 17:01

    Change your code to.

    let tap =  UITapGestureRecognizer(target: self, action: #selector(doubleTapped(_:)))
    

    and the function to.

    func doubleTapped(_ sender: AnyObject) {
        print("Double Tap")
    }
    

提交回复
热议问题