Use NavigationSplitView for iOS 16+ and Mac app

This commit is contained in:
Angelo Stavrow 2024-06-25 11:53:38 -04:00
parent e1cb3993e8
commit a8eca3d86b
No known key found for this signature in database
GPG Key ID: 1A49C7064E060EEE

View File

@ -18,20 +18,22 @@ struct WFNavigation<CollectionList, PostList, PostDetail>: View
}
var body: some View {
#if os(macOS)
NavigationSplitView {
collectionList
} content: {
postList
} detail: {
postDetail
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
NavigationSplitView {
collectionList
} content: {
postList
} detail: {
postDetail
}
} else {
NavigationView {
collectionList
postList
postDetail
}
}
#else
NavigationView {
collectionList
postList
postDetail
}
#endif
}
}