Implementing Universal Clipboard Between Apple Devices
Universal Clipboard is part of Continuity. A user copies text, a link, or an image on iPhone and pastes it on Mac or iPad without any additional steps. From a developer's perspective, this works through UIPasteboard.general on iOS and NSPasteboard.general on macOS — the system itself synchronizes the contents through the Handoff infrastructure.
What You Need to Do in Your Application
Most tasks related to Universal Clipboard are about properly working with the system clipboard, not special Continuity integration. If the application correctly reads and writes to UIPasteboard.general, Universal Clipboard works automatically.
Writing to the clipboard:
// Text
UIPasteboard.general.string = "https://myapp.com/item/123"
// Multiple types simultaneously — preferred
UIPasteboard.general.setItems([
[UTType.plainText.identifier: "Article Title"],
[UTType.url.identifier: URL(string: "https://myapp.com/article/123")!]
])
// Image
UIPasteboard.general.image = UIImage(named: "screenshot")
Reading with type checking:
if UIPasteboard.general.hasStrings {
let text = UIPasteboard.general.string
}
if UIPasteboard.general.hasURLs {
let url = UIPasteboard.general.url
}
Limitations to Be Aware Of
Privacy change in iOS 16+. When reading UIPasteboard.general from the background or without explicit user action, the system shows a system banner "[App] pasted from [Device]". This is not a bug — it's intentional behavior by Apple for privacy. It cannot be disabled.
Data size. The clipboard is not designed for large files. Images larger than a few MB slow down synchronization between devices. For file transfers, use AirDrop or iCloud.
Sensitive data. UIPasteboard.general is a public clipboard, any application can read it. For passwords and tokens, it's better to show a "Copy" button with explicit user action rather than copy automatically.
Private pasteboard. For internal operations within the application (drag and drop between components), use UIPasteboard(name:create:) with a unique name — such a clipboard is inaccessible to other applications and is not synchronized through Continuity.
When It's Not Universal Clipboard, But Something Else
If the task is to synchronize data between devices in the background, without user involvement — this is not Clipboard, it's CloudKit or iCloud Documents. Clipboard is only for explicit copy/paste.
If you need to transfer data in one motion without a clipboard — AirDrop via UIActivityViewController.
What's Included
- Correct
UIPasteboardAPI usage with support for multiple UTTypes - Reading with checking available types
- Handling privacy banner (iOS 16+) — informing users
- If necessary: private pasteboard for internal operations
- Testing on two devices with the same Apple ID
Timeline
2–3 days including testing on physical devices. If the task is limited to working with the clipboard within one application — 1 day. Pricing is calculated individually.







