How to add a delete button to Collection View Cell in Swift?

前端 未结 2 363
旧巷少年郎
旧巷少年郎 2020-12-29 17:20

Right now I have a list of scrolling usernames using a Collection View of buttons. But I’d like to add overlapping delete buttons to each row. They\'d need to be attached to

2条回答
  •  轮回少年
    2020-12-29 17:58

    Why not create custom UICollectionViewCell in IB and just add button to it ? Register it to your collectionView with :

    - registerNib:forCellReuseIdentifier:
    

    You can use delegate or notification to process button tap.

提交回复
热议问题