I spent a few hours trying to get rid if this error message on my app:
List with selection: SelectionManagerBox<String> tried to update multiple times per frame.
It is a macOS 14 app. As I wasn't able to find a fix, I decided to try to create a minimal reproductible example. And here is this example:
import SwiftUI
struct ContentView: View {
@State var selection: String = ""
@State var secondSelection: String = ""
var body: some View {
NavigationSplitView {
List(selection: $selection) {
NavigationLink("A", value: "A")
NavigationLink("B", value: "B")
NavigationLink("C", value: "C")
}
} content: {
List(selection: $secondSelection) {
NavigationLink("1", value: "1")
NavigationLink("2", value: "2")
NavigationLink("3", value: "3")
}
} detail: {
Text("\(selection) - \(secondSelection)")
}
}
}
#Preview {
ContentView()
}
As this example is really really simple, I suppose we can't do anything? Thanks!
I tried everything on my app but the issue seems to be linked to SwiftUI and NavigationSplitView…