I saw that the macOS 14 SDK added this:
@available(*, unavailable)
extension NSImage : @unchecked Sendable {
}
Do I interpret this correctly to mean that NSImage
is not Sendable
and this extension’s sole purpose is to document this fact?
I understand why NSImage
isn’t safe to use from multiple threads at the same time. But what is the best way to pass around images in async contexts, then? CGImage
is Sendable
and is a fine substitute for pixel-based images, but what about PDFs? Is the only feasible way to create a PDF-based NSImage
by doing everything on the main thread? (Except maybe load the file into a Data
?)
On the other hand, UIImage
is Sendable
, but I suppose that is because it uses a CGImage
under the hood?