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

--

--

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 🇮🇹