Page Menu
Home
Musing Studio
Search
Configure Global Search
Log In
Files
F10455694
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Subscribers
None
View Options
diff --git a/Shared/PostList/SearchablePostListFilteredView.swift b/Shared/PostList/SearchablePostListFilteredView.swift
index 01abb81..5279fea 100644
--- a/Shared/PostList/SearchablePostListFilteredView.swift
+++ b/Shared/PostList/SearchablePostListFilteredView.swift
@@ -1,34 +1,39 @@
import SwiftUI
@available(iOS 15, macOS 12.0, *)
struct SearchablePostListFilteredView: View {
@EnvironmentObject var model: WriteFreelyModel
@Binding var postCount: Int
@State private var searchString = ""
// Only used for NavigationStack in iOS 16/macOS 13 or later
- @State private var path: [WFAPost] = []
+// @State private var path: [WFAPost] = []
var collections: FetchedResults<WFACollection>
var fetchRequest: FetchRequest<WFAPost>
var onDelete: (WFAPost) -> Void
var body: some View {
-// if #available(iOS 16, macOS 13, *) {
-// NavigationStack(path: $path) {
-// Text("Hello, modern stack navigator!")
-// }
-// } else {
- DeprecatedListView(
- searchString: $searchString,
- collections: collections,
- fetchRequest: fetchRequest,
- onDelete: onDelete
- )
-// }
+ if #available(iOS 16, macOS 13, *) {
+ NavigationStack {
+ List(fetchRequest.wrappedValue, id: \.self, selection: $model.selectedPost) { post in
+ NavigationLink(
+ "\(post.title.isEmpty ? "UNTITLED" : post.title)",
+ destination: PostEditorView(post: post)
+ )
+ }
+ }
+ } else {
+ DeprecatedListView(
+ searchString: $searchString,
+ collections: collections,
+ fetchRequest: fetchRequest,
+ onDelete: onDelete
+ )
+ }
}
func delete(_ post: WFAPost) {
onDelete(post)
}
}
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Fri, Jan 31, 4:45 PM (18 h, 27 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3145912
Attached To
rWFSUI WriteFreely SwiftUI
Event Timeline
Log In to Comment