diff --git a/Shared/Navigation/ContentView.swift b/Shared/Navigation/ContentView.swift index 7eeea9f..b99118a 100644 --- a/Shared/Navigation/ContentView.swift +++ b/Shared/Navigation/ContentView.swift @@ -1,28 +1,27 @@ import SwiftUI struct ContentView: View { @ObservedObject var postStore: PostStore var body: some View { NavigationView { - PostList() + PostList(title: "Posts") .frame(maxHeight: .infinity) - .navigationTitle("Posts") .toolbar { NavigationLink(destination: PostEditor(post: Post())) { Image(systemName: "plus") } } Text("Select a post, or create a new draft.") .foregroundColor(.secondary) } .environmentObject(postStore) } } struct ContentView_Previews: PreviewProvider { static var previews: some View { ContentView(postStore: testPostStore) } } diff --git a/Shared/Post/PostList.swift b/Shared/Post/PostList.swift index 5ef4876..d3cac10 100644 --- a/Shared/Post/PostList.swift +++ b/Shared/Post/PostList.swift @@ -1,22 +1,24 @@ import SwiftUI struct PostList: View { @EnvironmentObject var postStore: PostStore + let title: String var body: some View { List { Text("\(postStore.posts.count) Posts") .foregroundColor(.secondary) ForEach(postStore.posts) { post in PostCell(post: post) } } + .navigationTitle(title) } } struct PostList_Previews: PreviewProvider { static var previews: some View { - PostList() + PostList(title: "Posts") .environmentObject(testPostStore) } } diff --git a/WriteFreely-MultiPlatform.xcodeproj/xcuserdata/angelo.xcuserdatad/xcschemes/xcschememanagement.plist b/WriteFreely-MultiPlatform.xcodeproj/xcuserdata/angelo.xcuserdatad/xcschemes/xcschememanagement.plist index 6cd8075..2723ebe 100644 --- a/WriteFreely-MultiPlatform.xcodeproj/xcuserdata/angelo.xcuserdatad/xcschemes/xcschememanagement.plist +++ b/WriteFreely-MultiPlatform.xcodeproj/xcuserdata/angelo.xcuserdatad/xcschemes/xcschememanagement.plist @@ -1,19 +1,19 @@ SchemeUserState WriteFreely-MultiPlatform (iOS).xcscheme_^#shared#^_ orderHint - 1 + 0 WriteFreely-MultiPlatform (macOS).xcscheme_^#shared#^_ orderHint - 0 + 1