Replies: 1 comment
-
Hi @bitomule, currently // Not @MainActor
class Model {
@Dependency(\.mainActorClient) var …
} This would require initializing a Theoretically the tools in the library could start holding onto their isolation as However, typically one does not need to make the dependency itself |
Beta Was this translation helpful? Give feedback.
-
Hello!
I have started a new app and I'm facing some issues with Dependencies and a dependency marked with MainActor. I have a CoreData client marked as MainActor and I'm trying to use it in a dependency like this:
This logs a warning "Main actor-isolated static property 'liveValue' cannot be used to satisfy nonisolated protocol requirement; this is an error in the Swift 6 language mode" and removing the MainActor from liveValue transform warning into this error: "Call to main actor-isolated static method 'buildDefault()' in a synchronous nonisolated context".
What's the best way to handle a case like this?
Beta Was this translation helpful? Give feedback.
All reactions