mirror of
https://github.com/writeas/writefreely-swiftui-multiplatform.git
synced 2024-11-15 01:11:02 +00:00
Get nav working from CollectionList > PostList > PostEditor
This commit is contained in:
parent
5fbb87ec1e
commit
3425cc7226
@ -18,15 +18,23 @@ struct WFNavigation<CollectionList, PostList, PostDetail>: View
|
||||
}
|
||||
|
||||
var body: some View {
|
||||
if #available(iOS 16, macOS 13, *) {
|
||||
/// This works better in iOS 17.5 but still has some issues:
|
||||
/// - Does not respect the editor-launching policy, going right to the NoSelectedPostView
|
||||
#if os(macOS)
|
||||
NavigationSplitView {
|
||||
collectionList
|
||||
} content: {
|
||||
postList
|
||||
} detail: {
|
||||
postDetail
|
||||
}
|
||||
#else
|
||||
if #available(iOS 16, *) {
|
||||
/// Consider converting this into a NavigationStack instead, and using `$model.selectedCollection` to set
|
||||
/// the detail view that should be shown. Try moving navigation state out of **WriteFreelyModel** and into
|
||||
/// **WFNavigation** instead, so that it eventually encapsulates _all_ things related to app navigation.
|
||||
NavigationSplitView {
|
||||
collectionList
|
||||
} content: {
|
||||
postList
|
||||
} detail: {
|
||||
postDetail
|
||||
postList
|
||||
}
|
||||
} else {
|
||||
NavigationView {
|
||||
@ -35,5 +43,6 @@ struct WFNavigation<CollectionList, PostList, PostDetail>: View
|
||||
postDetail
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user