mirror of
https://github.com/writeas/writefreely-swiftui-multiplatform.git
synced 2024-11-15 01:11:02 +00:00
53ab32b7a3
* Update Sparkle to latest version * Bump minimum macOS target For launch, I propose we support the current version of macOS (14.x) and one version earlier (13.x). * Add WFNavigation wrapper to use NavigationSplitView in macOS * Replace NavigationView with WFNavigation in ContentView * Fix deprecation warnings on locale * Update docs for updating the Mac app * Fix for being sent back to post list on app reactivate * Bump build version * Remove debugging statements * Bump Sparkle version to address security fix
38 lines
915 B
Swift
38 lines
915 B
Swift
import SwiftUI
|
|
|
|
struct WFNavigation<CollectionList, PostList, PostDetail>: View
|
|
where CollectionList: View, PostList: View, PostDetail: View {
|
|
|
|
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 os(macOS)
|
|
NavigationSplitView {
|
|
collectionList
|
|
} content: {
|
|
postList
|
|
} detail: {
|
|
postDetail
|
|
}
|
|
#else
|
|
NavigationView {
|
|
collectionList
|
|
postList
|
|
postDetail
|
|
}
|
|
#endif
|
|
}
|
|
}
|