This appears to severely limit the usefulness of hierarchical lists in SwiftUI.
I want to use the new hierarchical list/outline to display a filesystem tree. For data to pass to OutlineGroup, I created a class named FileSystemNode, and gave it a computed children property. When the getter is first called, it will read its directory contents to return a list (if it is a directory).
Problem is, when the OutlineGroup is first displayed, even though it is collapsed on-screen to a single node, it calls children and recurses over the entire filesystem.
Is there a way to stop this? If not, I hope it gets fixed before release.
(This is on macOS Big Sur beta)
I want to use the new hierarchical list/outline to display a filesystem tree. For data to pass to OutlineGroup, I created a class named FileSystemNode, and gave it a computed children property. When the getter is first called, it will read its directory contents to return a list (if it is a directory).
Problem is, when the OutlineGroup is first displayed, even though it is collapsed on-screen to a single node, it calls children and recurses over the entire filesystem.
Is there a way to stop this? If not, I hope it gets fixed before release.
(This is on macOS Big Sur beta)