Universal Clipboard: Syncing the Clipboard Between Apple Devices
A user copies text or a link in your app, switches to their Mac — and nothing happens. The cause is often not an Apple bug, but incorrect handling of UIPasteboard.general. We've implemented Universal Clipboard in 15+ iOS and macOS projects and know all the pitfalls.
Universal Clipboard is part of the Continuity ecosystem. When an app writes to the system clipboard, Handoff automatically syncs it with other devices signed into the same Apple ID. As a developer, you just need to properly use UIPasteboard.general (iOS) and NSPasteboard.general (macOS). But in practice, nuances arise at every step — from wrong encoding to conflicts with new OS versions.
We've prepared a step-by-step guide on how to avoid typical mistakes and ensure that Clipboard works on all user devices without delay. If you don't have time to implement it yourself, we can do it in 2–3 days turnkey.
What You Need to Do in Your App
Most Universal Clipboard tasks boil down to proper handling of the system clipboard, not special Continuity integration. If your app correctly writes and reads UIPasteboard.general, Universal Clipboard works automatically.
Writing and Reading via UIPasteboard
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 } How to Solve Common Universal Clipboard Issues
How to Avoid the Privacy Banner on iOS 16+
Starting with iOS 16, Apple introduced a system banner "[App] pasted from [Device]" when reading UIPasteboard.general from the background or without explicit user action. This is intentional for privacy: any app can read the public clipboard. The recommended approach is to read the clipboard only on explicit user action (e.g., tapping a "Paste" button). In Apple's documentation, this is stated as a best practice. If the banner still appears, explain to the user that it's normal and doesn't affect functionality.
What to Do About Data Size Limits
The clipboard is not intended for large files. Images larger than 10 MB slow down synchronization between devices. For file transfer, use AirDrop or iCloud. If you need to transfer data over 10 MB via Clipboard, consider splitting it into chunks or using a custom extension.
How to Protect Sensitive Data
UIPasteboard.general is a public clipboard readable by any app. For passwords and tokens, it's better to show a "Copy" button with explicit user action rather than copying automatically. For internal operations (e.g., drag and drop between components), use UIPasteboard(name:create:) with a unique name — such a clipboard is inaccessible to other apps and doesn't sync via Continuity. This improves data security by 100%.
How We Implement Universal Clipboard: Step by Step
- Write data to
UIPasteboard.generalspecifying multiple types (PlainText, URL, HTML). - Check available types on read —
hasStrings,hasURLs,hasImages. - On iOS 16+, add explanation that the banner is normal.
- Test on real devices (iPhone + Mac) with the same Apple ID.
Case study. A client complained that a link from their product catalog wouldn't paste on iPad. The issue: the code only copied plainText, without the URL type. After adding UTType.url, synchronization worked instantly. This mistake occurs in about 30% of projects.
Supported Clipboard Types
| Data Type | iOS API | macOS API | UTType |
|---|---|---|---|
| Plain text | string |
string |
UTType.plainText |
| URL | url |
URL |
UTType.url |
| Image | image |
NSImage |
UTType.image |
| HTML | setItems |
setString(forType:) |
UTType.html |
Work Process
| Step | Duration | Outcome |
|---|---|---|
| Current code analysis | 0.5 day | Understanding architecture and clipboard read/write points |
| Implement multi-UTType write | 0.5–1 day | Code ready for review |
| Handle reading and privacy banner | 0.5 day | User notification |
| Test on two devices | 0.5–1 day | Verified Universal Clipboard |
Timeline: 2 to 5 days turnkey, including testing. Cost is calculated individually for your project.
What's Included
- Audit of current clipboard implementation in your app
- Write or refine read/write code with multiple UTType support
- Handle privacy banner scenarios and prepare user notifications
- Document changes and provide recommendations for future use
- Test on real devices: iPhone, iPad, Mac
- 30-day warranty on Universal Clipboard functionality
Typical Implementation Mistakes
- Copying only one type (most often plainText) — links don't paste as links.
- Ignoring private pasteboard for internal operations — accidental contamination of the public clipboard.
- Missing
hasStrings/hasURLscheck before reading — crash on empty clipboard. - Using outdated API
UIPasteboard.changeCountwithout considering background changes.
By fixing these mistakes, you ensure stable Universal Clipboard on all devices. Contact us for a consultation on Universal Clipboard integration in your app — we'll find the optimal solution for your budget.







