I'm seeing a similar problem. Here I'm using an ObservedObject to update my app settings but get a build warning in the Command section
Main actor-isolated property 'body' cannot be used to satisfy nonisolated protocol requirement
The app seems to compile and run fine otherwise.
Feedback raised: FB13801673
struct MyCommands: Commands {
@ObservedObject var globalAppSettings: GlobalAppSettings
var body: some Commands {
SidebarCommands()
CommandGroup(after: CommandGroupPlacement.newItem) {
Divider()
Toggle("Debug Mode", isOn: $globalAppSettings.debugMode)
}
}
}
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags: