Hello, everyone.
I've been making an app looks like the default Notes app.
To implement the sidebar view, I've used the NavigationSplitView, and tried to control its columnVisibility. However, it doesn't work.
// some pseudo code
.onAppear {
columnVisibility = savedColumnVisibility
}
.onChange(of: columnVisibility) { value in
savedColumnVisibility = value
}
.onChange(of: scenePhase) { phase in
if phase == .activate {
load(savedColumnVisibility)
} else if phase == .background {
save(savedColumnVisibility)
}
}
Is there any way for me to persist the columnVisibility of NavigationSplitView?
Notes app can persist the columnVisibility:
However, my app can't persist it:
Thanks to watch my post!