Skip to content

Instantly share code, notes, and snippets.

@circAssimilate
Created August 22, 2022 20:41
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 circAssimilate/040a157327a8f20485bb04247f5dfb96 to your computer and use it in GitHub Desktop.
Save circAssimilate/040a157327a8f20485bb04247f5dfb96 to your computer and use it in GitHub Desktop.
extension NSScrollView {
var documentSize: NSSize {
set { documentView?.setFrameSize(newValue) }
get { documentView?.frame.size ?? NSSize.zero }
}
var documentOffset: NSPoint {
set { documentView?.scroll(newValue) }
get { documentVisibleRect.origin }
}
var isScrolledToEnd: Bool {
self.frame.height - (self.documentSize.height - self.documentOffset.y) == 0
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment