Post

Replies

Boosts

Views

Activity

Reply to Sidebar on the right in SwiftUI
Hey, Not sure if you found your answer yet, but you might be able to achieve that with Introspect. This library lets you interact with the AppKit/UIKit framework that SwiftUI uses. I'm assuming you are not using an Catalyst app, so you would be looking at the AppKit functionality. As you can see on the GitHub page, NSSplitViewController is not implemented in the library yet, however, UISplitViewController is. If you are using Catalyst, you can just write NavigationView { // Your views here } .introspectSplitViewController { controller in // some examples       controller.preferredSupplementaryColumnWidthFraction = 3 controller.preferredPrimaryColumnWidth = 180       controller.preferredDisplayMode = .twoBesideSecondary       controller.presentsWithGesture = false } You can set the width of each column as you wish. 1st column = Primary 2nd column = Supplementary 3rd column = Secondary You can use preferredcolumnColumnWidth for an exact width, or preferredcolumnColumnWidthFraction for a portion of your view. 1 is the standard size the column would get, 0.5 is half, ... If you are not using Catalyst, you could try to implement your own selector for Introspect (see bottom of GitHub page) to access the NSSplitViewController. I assume it does have similar variables to control the width, although they might be called different. If you want to go this route, Apple's documentation might help. Best of luck!
Aug ’21