I'm trying to implement a custom divider in an NSSplitViewController subclass. I want something similar to what Xcode has between the code editing area and the console area.
Ideally, I'd like to use SwiftUI for the internals of the divider itself.
I tried subclassing NSSplitView and overriding its dividerThickness property. That worked. What I can't figure out is how to actually use a custom view for the divider contents itself.
I'm looking at drawDivider(in rect: NSRect) which gives me an NSRect to work with, but I'm not sure if I can use the rect to "draw" a custom view.
I also tried this:
class FooController: NSSplitViewController {
override func loadView() {
splitView.arrangesAllSubviews = false
//...
splitView.addArrangedSubview(dividerView)
super.loadView()
}
}
But that results in an exception: A SplitView managed by a SplitViewController cannot have its arranged views modified.
What am I doing wrong? Am I on the right path? Should I even be subclassing NSSplitView? Or am I supposed to subclass NSSplitViewController? Or both? Or am I supposed to completely bypass NSSplitViewController and just use NSSplitView directly? Or what?