I have the following code snippet for clearing user's clipboard:
func clearClipboard() {
let pb = UIPasteboard.generalPasteboard()
let pbtypes = pb.pasteboardTypes()
for pbtype in pbtypes {
pb.setValue("", forPasteboardType: pbtype)
}
print("Clipboard was cleared")
}
I tested the code on iPhone running iOS 8.4 and it works. However, on iOS 9.3 it doesn't work. On iOS 9.3, the pbtypes
array is empty.
Did Apple change anything in the API permissions? Any advice will be appreciated.