swiftui-cached-async-image icon indicating copy to clipboard operation
swiftui-cached-async-image copied to clipboard

"[…] cannot be marked as '@Sendable'"

Open vladdeSV opened this issue 11 months ago • 2 comments

With Xcode 15.3, I get this warning on the load() method.

Instance methods of non-Sendable types cannot be marked as '@Sendable'; this is an error in Swift 6

vladdeSV avatar Mar 17 '24 13:03 vladdeSV

I think you can simplely change the usage to content(phase) .task(id: urlRequest) { await load() } And then remove @Sendable, warning would be gone.

wyk111wyk avatar May 16 '24 05:05 wyk111wyk

That solved the warning, and my code seems to work all right!

Thanks @wyk111wyk 🙌

vladdeSV avatar May 16 '24 06:05 vladdeSV