What is SwiftUI API equivalent to NSSplitViewItemAccessoryViewController in macOS?

On macOS Tahoe 26, NSSplitViewController introduced the NSSplitViewItemAccessoryViewController and related-APIs in NSSplitViewController, such as addBottomAlignedAccessoryViewController(_:). Those APIs allow you to place accessory views at the top and bottom of a split view with a nice edge effect.

I understand how to use them with AppKit. However, I’m not sure how to achieve the same functionality with SwiftUI.

Answered by Frameworks Engineer in 860132022

Take a look at safeAreaBar(edge:alignment:spacing:content:). It can overlay content at any point in the view tree, and scroll views within that modifier will automatically react by applying an edge effect. You can also use .scrollEdgeEffectStyle(_:for:) to change the style of the effect.

Accepted Answer

Take a look at safeAreaBar(edge:alignment:spacing:content:). It can overlay content at any point in the view tree, and scroll views within that modifier will automatically react by applying an edge effect. You can also use .scrollEdgeEffectStyle(_:for:) to change the style of the effect.

What is SwiftUI API equivalent to NSSplitViewItemAccessoryViewController in macOS?
 
 
Q