Page Menu
Home
Musing Studio
Search
Configure Global Search
Log In
Files
F10669346
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/Navigation/WFNavigation.swift b/Shared/Navigation/WFNavigation.swift
index c29a72f..5042f3c 100644
--- a/Shared/Navigation/WFNavigation.swift
+++ b/Shared/Navigation/WFNavigation.swift
@@ -1,26 +1,37 @@
import SwiftUI
struct WFNavigation<CollectionList, PostList, PostDetail>: View
where CollectionList: View, PostList: View, PostDetail: View {
- @ViewBuilder var collectionList: () -> CollectionList
- @ViewBuilder var postList: () -> PostList
- @ViewBuilder var postDetail: () -> PostDetail
+
+ private var collectionList: CollectionList
+ private var postList: PostList
+ private var postDetail: PostDetail
+
+ init(
+ @ViewBuilder collectionList: () -> CollectionList,
+ @ViewBuilder postList: () -> PostList,
+ @ViewBuilder postDetail: () -> PostDetail
+ ) {
+ self.collectionList = collectionList()
+ self.postList = postList()
+ self.postDetail = postDetail()
+ }
var body: some View {
if #available(iOS 16, macOS 13, *) {
NavigationSplitView {
- collectionList()
+ collectionList
} content: {
- postList()
+ postList
} detail: {
- postDetail()
+ postDetail
}
} else {
NavigationView {
- collectionList()
- postList()
- postDetail()
+ collectionList
+ postList
+ postDetail
}
}
}
}
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Fri, May 16, 3:11 AM (1 d, 9 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3239962
Attached To
rWFSUI WriteFreely SwiftUI
Event Timeline
Log In to Comment