I have a UICollectionView showing several items. I also have an edit button in the screen toolbar.
How can I have delete icons appear on each UICollectionViewCell when I press the toolbar edit button?
There is very little in the way of examples on google at the moment, so if anyone can point me in the right direction, that would be great.
Thanks
Editing items in
UICollectionViews aren’t done the same way as they’re done in aUITableView. In table views, there’s a editing mode that’ll show the delete button. But with collection views you gotta take care of that yourself.Initially, I solved it this way:
But after that I removed the edit button and added a
UILongPressGestureRecognizerto theUICollectionView. When long pressing an item I show theUIActionSheetthat shows the possible actions.One of those options might be a possibility for you.