Swift 6 + CGImage: How Do I Silence This Error?

In my app, I use AVFoundation to snap images of certain frames of video files. I cache those images by their frame number. I do this with TaskGroup and concurrency. Here's an extremely simplified example that shows the error I'm fighting:

CGImage explicitly conforms to @unchecked Sendable for macOS 10.9+ and the documentation declares it to be thread-safe. But using it here produces this warning/error and this is the last error stopping me from adopting Swift 6 language mode in this project.

If I replace CGImage with some other Sendable type, the error disappears, of course. But I want CGImage because I take each of these and run them through the Vision framework to find text snippets, and Vision requires CGImage inputs.

I'm running Xcode 16 Beta 2.

I'm expecting this to be fixed by Beta 3 or 4.

1 Like

Let's just say that Beta 3 did not improve the situation. That one error is gone and there are now 15 in its place: