An open API service indexing awesome lists of open source software.

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)

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/).