0

i have a collection view cell array, where i can add new objects from another screen. what i need to know is how can i delete one of the objects?

currently each cell contains, a uiImage, a label, and a delete button.. but i can't figure out the method to delete in collection view.

There are loads of ways to delete Tableview cells with swipe to delete etc. but i simply can't find the func to delete in collectionView. In Swift.

Any help at all would be greatly appreciated.

1 Answers1

0

Have you checked the following UICollectionView Delegate method?

func deleteSections(_ sections: NSIndexSet)
casillas
  • 16,351
  • 19
  • 115
  • 215
  • This Doesn't show up when i start typing. the only thing that shows up is delete(sender: AnyObject?).... do you think you can tell me what i may not be understanding? – Matthew Ehrlich Nov 23 '15 at 18:45
  • well, i can tell you that i have ViewController 1 which has the collection view cell. that cell contains, a uiimage, label, and a button. however... when i tried to add the button to the cell it was saying something about repeating content.. so i had to move the button to a subclass.. i did this and the button is hooked up to the subclass and works when it is tapped. currently when i tap the button it prints "Delete Button Selected" but nothing happens... – Matthew Ehrlich Nov 23 '15 at 19:00