Skip to content

Instantly share code, notes, and snippets.

View Hucent's full-sized avatar

Hucent

View GitHub Profile
@blundgren
blundgren / gist:a68d70f792f138bae23b
Created March 11, 2016 17:56
An NSClipView subclass which performs drag-scrolling.
class DraggableClipView: NSClipView
{
private var clickPoint: NSPoint!
private var originalOrigin: NSPoint!
override func mouseDown(event: NSEvent) {
clickPoint = event.locationInWindow
originalOrigin = bounds.origin
}