mirror of
https://github.com/XcodesOrg/XcodesApp.git
synced 2026-04-27 15:07:39 +00:00
Merge pull request #78 from RobotsAndPencils/matt/#71
#71 Update Filter/Info to use AppStorage
This commit is contained in:
commit
99a91eff2a
1 changed files with 6 additions and 2 deletions
|
|
@ -6,8 +6,12 @@ struct MainWindow: View {
|
||||||
@State private var selectedXcodeID: Xcode.ID?
|
@State private var selectedXcodeID: Xcode.ID?
|
||||||
@State private var searchText: String = ""
|
@State private var searchText: String = ""
|
||||||
@AppStorage("lastUpdated") private var lastUpdated: Double?
|
@AppStorage("lastUpdated") private var lastUpdated: Double?
|
||||||
@SceneStorage("isShowingInfoPane") private var isShowingInfoPane = false
|
// These two properties should be per-scene state managed by @SceneStorage property wrappers.
|
||||||
@SceneStorage("xcodeListCategory") private var category: XcodeListCategory = .all
|
// There's currently a bug with @SceneStorage on macOS, though, where quitting the app will discard the values, which removes a lot of its utility.
|
||||||
|
// In the meantime, we're using @AppStorage so that persistence and state restoration works, even though it's not per-scene.
|
||||||
|
// FB8979533 SceneStorage doesn't restore value after app is quit by user
|
||||||
|
@AppStorage("isShowingInfoPane") private var isShowingInfoPane = false
|
||||||
|
@AppStorage("xcodeListCategory") private var category: XcodeListCategory = .all
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
HSplitView {
|
HSplitView {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue