I am trying to read the text from the clipboard to a string.
I have tried the following code and it writes to the clipboard OK but I can not get it to read the data back into the string.
@IBAction func testButton(_ sender: Any) {
print("Test Started")
// copy to clipboard
let pb = NSPasteboard.general
pb.clearContents()
pb.setString("Hello World!", forType: NSPasteboard.PasteboardType.string)
// This worked solved problem
let cb = NSPasteboard.general.string(forType: .string)
print(cb)
}