How to add uibutton action in a collection view cell?

后端 未结 5 1060
走了就别回头了
走了就别回头了 2021-01-03 01:03

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 <

5条回答
  •  -上瘾入骨i
    2021-01-03 01:30

    On UICollectionView cell take button (Programmatically or using storyboard). Add action for that button in cell class file and declare delegate in that cell class file and call same delegate in button action method to perform edit action.

    Then implement same delegate in ViewController in which you have created collection view

提交回复
热议问题