Post

Replies

Boosts

Views

Activity

Reply to NavigationSplitView two and three column interfaces in the same app
I work on a predominantly SwiftUI app, but I managed to achieve this using two UISplitViewControllers and contain my SwiftUI views inside that. I basiccally made an outer two column UISplitViewController. The detail view there is a SwiftUI view that either shows one big view or a UIVIewRepresentable that houses another UISplitViewController, depending on sidebar selection. When that inner splitview is shown, I set the outer nav bar to hidden so just the inner splitview's navbar shows. It took a lot of fiddling with the column behaviours to get it to work just right, but it does work. Although once in a while I see crashes when rotating the iPad which may be attributed to SwiftUI trying to deal with two navigation controllers in the two different splitviews. I've also raised FB12586131 to ask that UISplitViewController and NavigationSplitView support proper switching between two and three column modes. All we really need is a way to hide the middle column only.
Aug ’23