A collection of user interface components and drawing routines for building tasteful apps using AppKit.
appkit swift aqua ui mac

Add SplitViewResizeCoordinator

+18
+18
Sources/AquaKit/Controls and Views/SplitViewResizeCoordinator.swift
··· 1 + import AppKit 2 + 3 + open class SplitViewResizeCoordinator: NSObject { 4 + public var splitView: NSSplitView 5 + public var dividerIndex: Int = 0 6 + 7 + public init(splitView: NSSplitView) { 8 + self.splitView = splitView 9 + } 10 + 11 + @MainActor 12 + @objc public func resize(_ sender: AquaResizeHandle) { 13 + guard let drag = sender.activeDrag else { return } 14 + let subview = splitView.arrangedSubviews[dividerIndex] 15 + let currentPosition = splitView.isVertical ? subview.frame.maxX : subview.frame.maxY 16 + splitView.setPosition(currentPosition + drag.delta, ofDividerAt: dividerIndex) 17 + } 18 + }