apple-text-representable

Wrap UIKit and AppKit text views in SwiftUI with representable wrappers.

Updated Mar 19, 2026
One-click install
npx skills add https://github.com/sitapix/apple-text --skill apple-text-representable
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: apple-text-representable
Source: https://github.com/sitapix/apple-text/tree/main/skills/apple-text-representable
Command: npx skills add https://github.com/sitapix/apple-text --skill apple-text-representable

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Wrapping UIKit/AppKit text views inside SwiftUI without breaking editing behavior, preserving focus, sizing, and cursor position.

Core Features & Use Cases

  • Provides UIViewRepresentable and NSViewRepresentable wrappers for UITextView and NSTextView.
  • Patterns for coordinator, focus management, auto-sizing, and cursor preservation across platforms.
  • Includes practical guidance for bridging SwiftUI with TextKit-based text editing.

Quick Start

Create a SwiftUI wrapper around UITextView / NSTextView using UIViewRepresentable / NSViewRepresentable that preserves focus, sizing, and cursor position.

Frequently Asked Questions about apple-text-representable

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I wrap UITextView in SwiftUI without losing focus or cursor position?

To wrap UITextView in SwiftUI while preserving focus and cursor position, use a robust UIViewRepresentable wrapper with a coordinator pattern to manage text editing state and sizing safely.

What is the best way to use NSTextView with SwiftUI for stable text editing?

The best way to use NSTextView with SwiftUI is implementing an NSViewRepresentable wrapper that handles coordinator patterns, focus management, and auto-sizing for cross-platform consistency.

Why does my SwiftUI text view wrapper break editing behavior and drop keystrokes?

SwiftUI text view wrappers break editing behavior when they lack proper coordinator patterns for binding and cursor preservation.

Can I use UIViewRepresentable and NSViewRepresentable for cross-platform text editing?

Yes, you can use UIViewRepresentable and NSViewRepresentable to achieve cross-platform consistency when wrapping TextKit-based text views in SwiftUI.

Do I need a coordinator to manage focus when wrapping UITextView in SwiftUI?

Yes, you need a coordinator to manage focus and cursor preservation when wrapping UITextView in SwiftUI.