For any future readers:
I figured out that it's important to set BOTH .preferredDisplayMode and .preferredSplitBehavior when the view transitions. Setting just one or the other will result in lots of weird behavior.
What I figured out works for this case is setting preferredDisplayMode = .twoBesideSecondary and preferredSplitBehavior = .tile when the screen is wide enough to fit all 3 columns, and when it is not, set preferredDisplayMode = .oneBesideSecondary and preferredSplitBehavior = .displace.
I used a function that checks if the view.frame.size.width < 1194 to determine if the screen is full width or not, as using orientation only would cause problems if the app is side by side with another. I'll probably tweak that value over time so don't take it as gospel, but it works for now. I call this function in viewDidLoad for initially setting the behaviors, then again in viewWillTransition(toSize:), using the size property there to update the behaviors.
Post
Replies
Boosts
Views
Activity
Not official, but I found this awesome sample project on GitHub: https://github.com/marcosatanaka/sidebar-ios14
It's very basic but gives a good idea of how to generally setup a UISplitViewController as root view and implement a Sidebar. It also gives some sample code for the new ways of setting up UICollectionViewCellRegistration and section snapshots with DiffableDataSource!
I should note that I'm not referring to .compact column mode (I have that working great). I'm referring to when the app is wide enough that the width class is still regular, so the triple column style is shown, but the screen is narrower due to portrait orientation or when another app is multitasked next to your app.
@FrameworksEngineer This fixed it! Thank you!