So I have this collection view with cells containing an edit button, located on the upper right corner. How do I wire up an action into it?
I tried adding <
protocol CollectionViewCellDelegte {
func collectionViewCellDelegte(didClickButtonAt index: Int)
}
class ImageCollectionViewCell: UICollectionViewCell {
var index = 0
var delegte: CollectionViewCellDelegte? = nil
@IBAction func buttonAction(_ sender: UIButton) {
if let del = self.delegte {
del.collectionViewCellDelegte(didClickButtonAt: index)
}
}
}