Here's a simple demo of the hierarchical List in SwiftUI. I'm testing it on macOS Big Sur, but unlike similar tree components in other UI toolkits, it asks for all its children immediately. So I can't use it for something like a file system…
I have a simple Example of NavigationSplitView with different types in the Sidebar, including an OutlineGroup.
Problem: OutlineGroup's parent nodes are selectable, child nodes (leafs) are not.
Nodes without children also are not selectable.
Target…
OutlineGroup is an analogue to NSOutlineView. NSOutlineView supports single/multiple node selection and we can obtain them by querying on NSOutlineView. Though obtaining selection on NSOutlineView is O(n), but this can be optimized to O(1) if the…
I'm trying to use the new SwiftUI OutlineGroup to display an expandable tree. I tried this in my app's ContentView:
struct ContentView: View {
@EnvironmentObject var store: MyDataStore
var body: some View {
List {
…