How can I fix an NSRulerView in macOS 26 drawing into/conflicting with the window title bar?

2 days ago 1
ARTICLE AD BOX

When attaching a vertical ruler to a scroll view the separator is drawn all the way to the top of the window (macOS Tahoe):
vertical ruler on macOS 26 Tahoe

Compare this to how it works in previous versions, such as macOS Sequoia (15.7.2):
vertical ruler on macOS Sequoia 15.7.2

Is this expected behaviour? Can it be fixed?

The screenshots were generated with a minimal SwiftUI app embedding an NSTextView and NSRulerView using NSViewRepresentable, see below.

struct CustomEditor: NSViewRepresentable { @Binding var text: String func makeNSView(context: Context) -> NSScrollView { let scrollView = NSTextView.scrollableTextView() let editorView = scrollView.documentView as! NSTextView scrollView.verticalRulerView = NSRulerView(scrollView: scrollView, orientation: .verticalRuler) scrollView.rulersVisible = true editorView.delegate = context.coordinator return scrollView } func updateNSView(_ scrollView: NSScrollView, context: Context) { context.coordinator.owner = self } func makeCoordinator() -> CustomEditorCoordinator { return CustomEditorCoordinator(owner: self) } }
Read Entire Article