Swiftpack.co - ChimeHQ/ScrollViewPlus as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by ChimeHQ.
ChimeHQ/ScrollViewPlus 0.2.0
A more pleasant NSScrollView experience
⭐️ 15
🕓 2 weeks ago
macOS
.package(url: "https://github.com/ChimeHQ/ScrollViewPlus.git", from: "0.2.0")

Build Status Platforms

ScrollViewPlus

ScrollViewPlus is a small library that provides some helpful extension and capabilities for working with NSScrollView.

Integration

Swift Package Manager

dependencies: [
    .package(url: "https://github.com/ChimeHQ/ScrollViewPlus.git")
]

Classes

ScrollViewVisibleRectObserver

Simple class to monitor the user-visible portion of an NSScrollView document view.

ObservableScroller

An NSScroller subclass that makes it possible to determine the overlay style's slot thickness and detect changes to it.

ScrollerOverlayObserver

A class that can be used to observe the scroller overlay size and visibily changes. This makes use of some heuristics that aren't perfect, but the end result is quite good. Must be used in combination with ObservableScroller, but does not enforce an NSScrollView subclass requirement.

OverlayOnlyScrollView

A very simple NSScrollView subclass that will always use overlay style scrollers, regardless of user prefs or input device types.

PositionJumpingWorkaroundScrollView

A class that works around a pretty esoteric problem:

The scroll-position jumping will occur if this view contains an NSTextView and:

  • non-contiguous layout enabled for the NSTextView's NSLayoutManager
  • there are actual non contiguous blocks in the layout
  • the NSTextView is configured so text does not wrap to the view's bounds
  • there are at least some lines of text that are actually larger than the view's bounds
  • the containing NSScrollView has a vertical ruler present
  • the pointing device is a trackpad

Contributing and Collaboration

I would love to hear from you! Issues or pull requests work great. A Discord server is also available for live help, but I have a strong bias towards answering in the form of documentation.

I prefer collaboration, and would love to find ways to work together if you have a similar project.

I prefer indentation with tabs for improved accessibility. But, I'd rather you use the system you want and make a PR than hesitate because of whitespace.

By participating in this project you agree to abide by the Contributor Code of Conduct.

GitHub

link
Stars: 15
Last commit: 2 weeks ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

Release Notes

v0.2.0
2 weeks ago
  • Concurrency support

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics