Skip to content

Instantly share code, notes, and snippets.

@zentrope
Created February 22, 2020 06:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zentrope/b3b3591e2eded26c86ae9fbe5e30f6fa to your computer and use it in GitHub Desktop.
Save zentrope/b3b3591e2eded26c86ae9fbe5e30f6fa to your computer and use it in GitHub Desktop.
override func splitView(_ splitView: NSSplitView, additionalEffectiveRectOfDividerAt dividerIndex: Int) -> NSRect {
super.splitView(splitView, additionalEffectiveRectOfDividerAt: dividerIndex)
assert(splitViewItems.count == 2)
if splitViewItems.count != 2 { return .zero }
if !splitViewItems[1].isCollapsed { return .zero }
return NSMakeRect(splitView.bounds.maxX-6, 0, 6, splitView.bounds.height)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment