File tree Expand file tree Collapse file tree 2 files changed +14
-14
lines changed Expand file tree Collapse file tree 2 files changed +14
-14
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,18 @@ struct ContentView: View {
13
13
. foregroundColor ( . secondary)
14
14
}
15
15
. environmentObject ( model)
16
+
17
+ #if os(iOS)
18
+ EmptyView ( )
19
+ . sheet (
20
+ isPresented: $model. isPresentingSettingsView,
21
+ onDismiss: { model. isPresentingSettingsView = false } ,
22
+ content: {
23
+ SettingsView ( )
24
+ . environmentObject ( model)
25
+ }
26
+ )
27
+ #endif
16
28
}
17
29
}
18
30
Original file line number Diff line number Diff line change @@ -7,10 +7,6 @@ struct PostListView: View {
7
7
@State var selectedCollection : WFACollection ?
8
8
@State var showAllPosts : Bool = false
9
9
10
- #if os(iOS)
11
- @State private var isPresentingSettings = false
12
- #endif
13
-
14
10
var body : some View {
15
11
#if os(iOS)
16
12
GeometryReader { geometry in
@@ -31,18 +27,10 @@ struct PostListView: View {
31
27
ToolbarItem ( placement: . bottomBar) {
32
28
HStack {
33
29
Button ( action: {
34
- isPresentingSettings = true
30
+ model . isPresentingSettingsView = true
35
31
} , label: {
36
32
Image ( systemName: " gear " )
37
- } ) . sheet (
38
- isPresented: $isPresentingSettings,
39
- onDismiss: {
40
- isPresentingSettings = false
41
- } ,
42
- content: {
43
- SettingsView ( isPresented: $isPresentingSettings)
44
- }
45
- )
33
+ } )
46
34
. padding ( . leading)
47
35
Spacer ( )
48
36
Text ( pluralizedPostCount ( for: showPosts ( for: selectedCollection) ) )
You can’t perform that action at this time.
0 commit comments