Page Menu
Home
Musing Studio
Search
Configure Global Search
Log In
Files
F10669939
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
4 KB
Subscribers
None
View Options
diff --git a/Shared/Navigation/ContentView.swift b/Shared/Navigation/ContentView.swift
index 34c34c0..c67efba 100644
--- a/Shared/Navigation/ContentView.swift
+++ b/Shared/Navigation/ContentView.swift
@@ -1,27 +1,28 @@
import SwiftUI
struct ContentView: View {
@ObservedObject var postStore: PostStore
var body: some View {
NavigationView {
PostList(postStore: postStore)
.frame(maxHeight: .infinity)
.navigationTitle("Posts")
.toolbar {
- NavigationLink(destination: PostEditor(post: Post()).environmentObject(self.postStore)) {
+ NavigationLink(destination: PostEditor(post: Post())) {
Image(systemName: "plus")
}
}
Text("Select a post, or create a new draft.")
.foregroundColor(.secondary)
}
+ .environmentObject(self.postStore)
}
}
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView(postStore: testPostStore)
}
}
diff --git a/Shared/Post/PostCell.swift b/Shared/Post/PostCell.swift
index 86ea0b3..3696b0f 100644
--- a/Shared/Post/PostCell.swift
+++ b/Shared/Post/PostCell.swift
@@ -1,40 +1,40 @@
import SwiftUI
struct PostCell: View {
@EnvironmentObject var postStore: PostStore
@ObservedObject var post: Post
var body: some View {
NavigationLink(
- destination: PostEditor(post: post).environmentObject(self.postStore)
+ destination: PostEditor(post: post)
) {
HStack {
VStack(alignment: .leading) {
Text(post.title)
.font(.headline)
.lineLimit(1)
Text(buildDateString(from: post.createdDate))
.font(.caption)
.foregroundColor(.secondary)
.lineLimit(1)
}
Spacer()
PostStatusBadge(post: post)
}
}
}
func buildDateString(from date: Date) -> String {
let dateFormatter = DateFormatter()
dateFormatter.dateStyle = .long
dateFormatter.timeStyle = .short
return dateFormatter.string(from: date)
}
}
struct PostCell_Previews: PreviewProvider {
static var previews: some View {
PostCell(post: testPost)
}
}
diff --git a/Shared/Post/PostList.swift b/Shared/Post/PostList.swift
index 07bf01c..03d2b1c 100644
--- a/Shared/Post/PostList.swift
+++ b/Shared/Post/PostList.swift
@@ -1,21 +1,21 @@
import SwiftUI
struct PostList: View {
@ObservedObject var postStore: PostStore
var body: some View {
List {
Text("\(postStore.posts.count) Posts")
.foregroundColor(.secondary)
ForEach(postStore.posts) { post in
- PostCell(post: post).environmentObject(self.postStore)
+ PostCell(post: post)
}
}
}
}
struct PostList_Previews: PreviewProvider {
static var previews: some View {
PostList(postStore: 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 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>WriteFreely-MultiPlatform (iOS).xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
- <integer>1</integer>
+ <integer>0</integer>
</dict>
<key>WriteFreely-MultiPlatform (macOS).xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
- <integer>0</integer>
+ <integer>1</integer>
</dict>
</dict>
</dict>
</plist>
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Fri, May 16, 6:33 PM (11 h, 29 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3240362
Attached To
rWFSUI WriteFreely SwiftUI
Event Timeline
Log In to Comment