Mac Catalyst SplitViewController, UITitlebar bugs?

Bringing my iPad app to Mac Catalyst as iPad idiom. Primary interface is a UISplitViewController. Two things I think are bugs unless someone replies with a fix.

SplitViewController is setup in two column with left column as sidebar:

split.setViewController(primary, for: .primary)
split.setViewController(secondary, for: .secondary)
split.preferredDisplayMode = .oneBesideSecondary
split.preferredSplitBehavior = .tile
split.presentsWithGesture = true

#if targetEnvironment(macCatalyst)
split.primaryBackgroundStyle = .sidebar
split.displayModeButtonVisibility = .never
#endif
  1. The displayMode button aligns vertically with the navigation bar and below the 3 window control buttons (close, minimize, full screen), whereas on other macOS apps using SplitViewController such as Apple Notes app, the displayMode button aligns vertically and just to the right of the the 3 window control buttons (close, minimize, full screen). I downloaded the Apple Example app called Menus that is supposed to be a prime example of a Mac Catalyst app, and I see author must have faced the same bug and instead created their own displayMode button and placed it on the UITitlebar's toolBar.

  2. In my secondary ViewController which is a subclass of a UITableViewController, tapping a row, calls show and in a SplitViewController, that pushes another detailVC onto the Nav stack as expected. The UIWindowScene's UITitlebar which appears over the top of the secondary VC looks correct.

This detailVC is a subclass of a UITableViewController. Finally, tapping a row in the table of the detailVC calls show but this time, the ViewController is actually a UIHostingViewController wrapping a SwiftUI View. At this point the UIWindowScene's UITitlebar changes appearance and takes on the same lightened color similar to the sidebar (primary) appearance.

With UITitlebarTitleVisibility set to hidden and if I set the titlebar.toolbar to nil, (which removes the UITitlebar, there is no appearance issue.

Running on iPad, with no UITitlebar, there is no odd lightening experienced when the UIHostingController is shown. I think this has something to do with the UIHostingController within Mac Catalyst.

Could you please share a link to a test project so we can reproduce the issue. That'll help us better understand what's going on. If you're not familiar with preparing a test project, take a look at Creating a test project.

Mac Catalyst SplitViewController, UITitlebar bugs?
 
 
Q