Post

Replies

Boosts

Views

Activity

Comment on Is it possible to track history using HistoryDescriptor in SwiftData?
So the following CoreData can also be written as SwiftData? func fetchPersistentHistory() { let context = persistentContainer.newBackgroundContext() context.perform { let lastToken = self.loadLastToken() let request = NSPersistentHistoryChangeRequest.fetchHistory(after: lastToken) if let result = try? context.execute(request) as? NSPersistentHistoryResult,. let transactions = result.result as? [NSPersistentHistoryTransaction] {
Sep ’24