wrmorgue
(Nikita Rossik)
1
Using the class below:
@Observable
final class AppState: Sendable {
enum Stage: Sendable {
case authorizationRequired
case authorized
}
static var shared = AppState()
var currentStage: AppState.Stage
// Warning: Stored property '_currentStage' of 'Sendable'-conforming class 'AppState' is mutable
// … other code
}
I get the following warning:
Applying the @MainActor doesn't resolve the issue. Documentation said:
Contain only stored properties that are immutable and sendable
I do understand what the warning says, but I need the mutability.
I have read a similar topic, but I don't understand what I need to do ?
1 Like