Pasteboard Clear

Is it possible to clear the pasteboard?

I have tried pasteboard.text = nil and pasteboard.image = nil but setting the text to nil doesn’t change it from what it was, and setting the image to nil returns an error.

@JakAttak you could set pasteboard.text to an empty string, e.g., pasteboard.text = "" — does that help?

@Simeon, yes that is my current solution, unfortunately can’t do the same for pasteboard.image

@JakAttak you can, it changes the type of file on the pasteboard from an image to an empty string by doing pasteboard.copy(“”)

@Luatee, pasteboard.text clears pasteboard.image as well? (I didn’t actually test I just assumed it wouldn’t)

@JakAttak I’m not sure, I’ve only ever used pasteboard.image and pasteboard.text for reading the pasteboard and I use pasteboard.copy(something) to copy, so setting it to a blank string works fine.

Why would you clear the pasteboard? It’s not really something meant to be cleared, it just saves in the background for later use.

@SkyTheCoder Cut and paste? That’s how I used it in my paint app

@SkyTheCoder Maybe they don’t want whoever picks up the device next to be able to see what was put on the pasteboard. If it’s a school iPad, then multiple students might use the same device.

@SkyTheCoder, I want to clear the pasteboard so that it is either filled with what I want, or it is empty.