use do { try ... } catch { ... }
or ignore the error just by using try?
do {
try modelContext.save()
print("Item updated.")
} catch {
print("Failed to edit item: \(error.localizedDescription)")
}
or just use try? modelContext.save()
Top comments (0)