Universal Clipboard / UIPasteboard hangs on iOS 10

I think Universal Clipboard is going to be a source of alot of hangs and stability problems in apps on iOS 10. I've noticed my app on iOS 10 hangs for up to 10-15 seconds when trying to access [UIPasteboard generalPasteboard].changeCount from the main thread. To reproduce this problem just make sure you have Continuity enabled and are signed into the same iCloud account on macOS 10.12 and iOS 10. Then copy text from a web page in Safari on macOS and watch [UIPasteboard generalPasteboard].changeCount on your iOS device hang for up to 5-10 seconds trying to do it's magic in the api call.


Has anyone seen this? Any recomendations on how to get around this? The way universal clipboard is implemented at the moment is going to cause alot of problems for users.

Same here, and I don't know how to get universal clipboard to work :-(

It's exactly what I'm trying to solve!


UIPasteBoard doesn't work on background thread (I've not tested on it, however, generally UIKit on background thread might show an unexpected behaviors) and UIPasteboardOptionLocalOnly seems to be used as a "write-only" key.


At least it would be great if we can get a [UIPasteboard localPasteboard]-like method to exclude handoff feature.

Universal Clipboard / UIPasteboard hangs on iOS 10
 
 
Q