I have a question about NSSplitViewItemAccessoryViewController, introduced with the new design since macOS 26, and how it interacts with NSScrollView content insets.
My app has a typical three-pane window whose content view controller is an NSSplitViewController subclass. The sidebar contains a tab view with a segmented control, similar to Xcode, for switching between different sidebar panes. Each pane contains an NSScrollView whose content can be scrolled.
Before macOS 26, I placed the segmented control directly inside the sidebar view. To adopt the new scroll-edge effect and allow the sidebar content to extend visually into the window title bar, I moved the segmented control into an NSSplitViewItemAccessoryViewController.
However, with this layout, the scroll view starts immediately below the segmented control, which feels visually cramped. I'd like to add a few points of top inset before the document view begins.
Previously, I achieved this by setting:
scrollView.additionalSafeAreaInsets.top
However, this now causes the accessory view's scroll-edge effect to extend into the additional safe-area inset, producing an awkward blurred region underneath the segmented control.
Ideally, I'd like the scroll view to begin directly below the segmented control while still having a small inset before the document content, with the scroll-edge effect ending exactly at the bottom of the accessory view.
In addition to additionalSafeAreaInsets, I tried the following approaches, but neither produced the desired result:
- Set
scrollView.automaticallyAdjustsContentInsetsto false and specifyscrollView.contentInsets.top.- This disables the automatic safe-area adjustment, causing the entire scroll view to move upward underneath the accessory view.
- Set
scrollView.contentView.automaticallyAdjustsContentInsetsto false and specifyscrollView.contentView..contentInsets.top.- This produces the same result as above.
- Set the accessory view's
preferredScrollEdgeEffectStyleto .soft.- The segmented control becomes too transparent, making its unselected labels difficult to read.
Xcode's sidebar appears to achieve the behavior I'm looking for. What is the recommended way to implement this layout on macOS 26 and 27?
Xcode's sidebar (macOS 26)
My app's sidebar (macOS 26, work in develop)
with additionalSafeAreaInsets