Get notified when pasteboard did change

Observe NSPasteboard — Swift 4

How to listen for clipboard changes

Photo by Max Nelson on Unsplash

Today I was thinking about apps like Clippy and other clipboard managers, I thought: “For sure swift provides notification for the copy event”

WRONG! I sadly discovered that on MacOS unlike on iOS you can’t listen for NSClipboard

--

--

--

FrontEnd Engineer. Secretly in love with strong typed languages. Sharing what I learn 🇮🇹

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

5+1 short-term ways to avoid high-load disasters in managed database services

When the App Breaks

Monitor gRPC Microservices in Kubernetes with Amazon X-Ray

Introducing Squaresett

Recently viewed implementation using Redis as cache

Python’s implementation of factory and abstract factory pattern

Documenting the project with a GitHub wiki

Implement a dependance to an external service API with Laravel

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Federico Vitale

Federico Vitale

FrontEnd Engineer. Secretly in love with strong typed languages. Sharing what I learn 🇮🇹

More from Medium

Adding Shapes and Background in the Omnitrix SwiftUI watchOS App

Building A Lightweight Camera App In SwiftUI

How to show taps on the iPhone using a Bluetooth mouse

Sign in With Apple — Guide for App Owners