What problem does it solve?
Copy, cut, and paste operations in Apple text editors often carry unwanted formatting, behave inconsistently across components, and complicate image pastes. This Skill provides guidance to sanitize pasted content, define and read custom pasteboard types, and integrate paste handling with UITextView and NSTextView for predictable, clean editing experiences.
Core Features & Use Cases
- Rich-text sanitization: strip or preserve select attributes when pasting to maintain visual consistency.
- Custom pasteboard types: define internal formats to exchange data reliably between app components.
- Image and attachment handling: paste images as NSTextAttachment and scale to fit the text container.
- NSItemProvider integration: support modern paste/drag/drop flows across iOS and macOS.
- Use Case: integrate sanitized paste into a note-taking app or code editor to avoid unexpected formatting.
Quick Start
Describe how to implement sanitized paste handling in a UITextView for a notes app.