Hi,
using the following ContentView
in a SwiftUI app on macOS I would expect that the state of the toggle persists across application launches:
struct ContentView: View {
@SceneStorage("Toggle") var onOrOff: Bool = false
var body: some View {
VStack {
Toggle("Will it persist?", isOn: $onOrOff)
.padding()
}
}
}
To my surprise it does not persist. Am I wrong about how @SceneStorage
should work? (I am trying this on the lates macOS/Xcode versions)
Does @SceneStorage
work for anybody on macOS?
Thanks for your feedback!
Cheers, Michael
Seems like nobody is using SwiftUI on macOS :-(
So far I tried it on three different machines (all running the lates macOS/Xcode). One even installed from scratch, to be sure it's nothing in my installation. So my guess is, that it's just broken. I filed FB10011754 for this.
Anyway if somebody has
@SceneStorage
working on macOS I would like to hear from you and maybe figure out what's different that makes it work.I'm having a similar issue on Mac with Xcode 15