My code below deletes a string from the index via delete button. However it is not delete from the core data set. If view is refreshed all items in the set are still there. All I want is when the user hits the delete func that that string is deleted forever. This is a download link to my code https://www.dropbox.com/s/m5fpiilksye4pru/photo2.zip?dl=0
var users = [Item]()
class cell: UICollectionViewCell {
var delegateA: datacollectionProfotocol?
var index : IndexPath?
@IBOutlet var name : UILabel!
@IBAction func show() {
}
@IBAction func delete() {
delegateA?.deleteData(indx: (index?.row)!)
}
}
protocol datacollectionProfotocol {
func deleteData(indx:Int)
}
extension ViewController : datacollectionProfotocol {
func deleteData(indx: Int) {
users.remove(at: indx)
block.reloadData()
}