Patika_ListApp CoreData -> delete all item in entity @IBAction func didRemoveBarButtonItemTapped(_ sender: Any) { presentAlert(title: "Uyarı!", message: "Listedeki bütün öğeleri silmek istediğinize emin misiniz?", defaultButtonTitle: "Evet", cancelButtonTitle: "Vazgeç") { _ in let appDelegate = UIApplication.shared.delegate as? AppDelegate let managedObjectContext = appDelegate?.persistentContainer.viewContext for item in self.data { managedObjectContext?.delete(item) } try? managedObjectContext?.save() self.fetch() } }