Swift, Swiftui, iOS App Development, Mobile App Development, Programming.
Item(timestamp: date) modelContext.insert(item) try modelContext.save() return item.persistentModelID } ​ public func updateItem(id: PersistentIdentifier, timestamp: Date) throws { guard let item = self[id, as: Item.self] else { return } item.timestamp = timestamp try modelContext.save() } ​ public