I'm starting to work on updating my code for Swift 6. I have a number of pieces of code that look like this:
private func updateModel() async throws {
try await context.perform { [weak self] in
// do some work
}
}
After turning on strict concurrency checking, I get warnings on blocks like that saying "Sending 'self.context' risks causing data races; this is an error in the Swift 6 language mode."
What's the best way for me to update this Core Data code to work with Swift 6?