2

I have a small app that contains an NSSplitViewController with 3 vertical split views (sidebar, content view, details view) kind of like the Mail app. I have programmatically changed the color of the divider between the different split views and that worked fine until macOS 11.

Unfortunately since upgrading the project to support macOS 11 the divider between the sidebar and the content view is back to the default apple color both in light and dark theme, and my override does not seem to work any longer.

I am currently simply subclassing NSSplitView and overriding dividerColor method as described by the Apple documentation

// ... You can override this method to change the color of dividers.
@available(macOS 10.5, *)
@NSCopying open var dividerColor: NSColor { get }

The other divider looks perfectly fine as is working as expected.

Any clues on how to override the color of the sidebar divider??

Thanks in advance for any suggestions.

cgiacomi
  • 4,629
  • 6
  • 27
  • 33

1 Answers1

0

You could try to use this method to draw the divider by yourself :

func drawDivider(in rect: NSRect)

It's even possible to call super from this method if for some reason you need the original design at times.

dspr
  • 2,383
  • 2
  • 15
  • 19