2 ms·
You can poll the changeCount property to quickly check if the clipboard has been updated. You would not need to constantly wake up the clipboard owner. To “cle
by nicky0 7y ago
You can poll the changeCount property to quickly check if the clipboard has been updated.
You would not need to constantly wake up the clipboard owner. To “clear” the clipboard you just upload a new clipboard with an empty string.
- ken 7y agoThat would be cool, if true. It was not clear to me from the documentation that this number is guaranteed to increment whenever the contents change. The value is described as counting "pasteboard ownership changes", and its use is to "determine whether you still have ownership". -clearContents doesn't say anything about necessarily changing it if you were already the owner, though that does seem to be the behavior today. I suppose this could be one of those cases where we can go by what it actually does, not just what the documentation says it does. I hate doing that, because it has a way of coming back to bite me.