I had the same message but with a different code. My code was:
for item in items {
guard let nsImage = NSImage(data: item) else { continue }
images.append(Image(nsImage: nsImage))
}
I resolved the message error with this:
DispatchQueue.global(gps: .background).async {
for item in items {
guard let nsImage = NSImage(data: item) else { continue }
images.append(Image(nsImage: nsImage))
}
}
Hope this helps to everybody.