ggruen / CloudKitSyncMonitor

Monitor current state of NSPersistentCloudKitContainer sync
MIT License
486 stars 44 forks source link

Use of `@MainActor` throwing warnings when initializing outside of Swift concurrency #29

Closed benguild closed 1 month ago

benguild commented 2 months ago

Hi, RE: #24, in cases where an app is not entirely using async await, these warnings are appearing when (for example) this is already being initialized statically from the main queue.

There should probably be a way to initialize this outside of the singleton without requiring this configuration.

ggruen commented 1 month ago

@JPToroDev do you know if this is still an issue (or perhaps more of an issue) with your recent changes?

JPToroDev commented 1 month ago

I suspect this issue has more to do with the concurrency coexistence approach than with SyncMonitor’s @MainActor status, but I'd need to do some tests to be sure. @benguild If you're still encountering this issue, could you share a small example?

benguild commented 1 month ago

Hmm, seems resolved with the changes— I'll close for now and respond back later if anything comes up. Thanks for your reply back.