https://zeddios.tistory.com/987
https://modelinspring.tistory.com/m/91
code for change data and store
let fetchRequest2: NSFetchRequest<StickerNumbers> = StickerNumbers.fetchRequest()
fetchRequest2.predicate = NSPredicate(format: "id == %d", 70)
do {
let results = try container.viewContext.fetch(fetchRequest2)
if let entity = results.first {
// Modify the properties of the entity as needed
entity.number = 5
// Save the changes to the managed object context
try container.viewContext.save()
} else {
print("Entity with id 3 not found.")
}
} catch {
print("Error fetching entity: \\(error)")
}