https://github.com/hisaac/pasteboardpublisher
A custom Combine publisher for NSPasteboard (Currently a work-in-progress)
https://github.com/hisaac/pasteboardpublisher
combine combine-framework nspasteboard pasteboard spm swift swift-package swift-package-manager
Last synced: 2 months ago
JSON representation
A custom Combine publisher for NSPasteboard (Currently a work-in-progress)
- Host: GitHub
- URL: https://github.com/hisaac/pasteboardpublisher
- Owner: hisaac
- License: mit
- Created: 2021-03-05T16:18:43.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2022-12-05T17:46:24.000Z (over 2 years ago)
- Last Synced: 2025-01-28T08:53:15.075Z (4 months ago)
- Topics: combine, combine-framework, nspasteboard, pasteboard, spm, swift, swift-package, swift-package-manager
- Language: Swift
- Homepage:
- Size: 19.5 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PasteboardPublisher
PasteboardPublisher is a simple library that adds a Combine publisher to AppKit's `NSPasteboard` class.
I created this because there is currently no way to "subscribe" to changes to an `NSPasteboard`, so it must be done by repeatedly polling the pasteboard's `changeCount`. This library just abstracts that away, and adds Combine compatability. I used this library in my pasteboard filtering app, [Plain Pasta](https://github.com/hisaac/PlainPasta), to great success.
I used many articles to build this library, but the one that finally connected the dots for me was [Creating a custom Combine Publisher to extend UIKit](https://www.avanderlee.com/swift/custom-combine-publisher/) by [Antoine van der Lee](https://www.avanderlee.com/about/).