txt-appkit-vs-uikit

Compares NSTextView and UITextView capabilities for cross-platform text editor porting.

2|Updated Sep 8, 2026
One-click install
npx skills add https://github.com/hanshi-notes/hanshi --skill txt-appkit-vs-uikit-hanshi-notes
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: txt-appkit-vs-uikit
Source: https://github.com/hanshi-notes/hanshi/tree/main/.agents/skills/txt-appkit-vs-uikit
Command: npx skills add https://github.com/hanshi-notes/hanshi --skill txt-appkit-vs-uikit-hanshi-notes

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Porting a text editor between macOS and iOS fails when developers assume NSTextView and UITextView are interchangeable; this Skill maps exactly which features exist on each side and classifies each gap as architectural, API-level, or stack-level so porting effort is scoped correctly. ## Core Features & Use Cases - Capability comparison: Catalogs AppKit-only features (text tables, formatting panels, grammar checking, Services menu, field editor, RTF I/O) and UIKit-only features (UITextInteraction, UITextItem interactions, UITextSelectionDisplayInteraction, UITextLoupeSession, declarative dataDetectorTypes). - Architectural guidance: Explains structural differences in inheritance, scrolling, text storage optionality, selection models, and delegate richness that shape every cross-platform editor. - Porting pitfalls: Documents common mistakes such as assuming NSTextView scrolls itself, touching shared field-editor properties, and silently triggering TextKit 1 fallback. - Use Case: When planning a Mac Catalyst version of an iOS text editor, use this Skill to determine which features need reimplementation versus simple API translation. ## Quick Start Ask the AI to compare NSTextView and UITextView support for a specific text editing feature you plan to port between macOS and iOS.

Frequently Asked Questions about txt-appkit-vs-uikit

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

FAQPage Schema
How do I port a UITextView-based editor to macOS AppKit?▼

Porting UITextView to AppKit requires wrapping NSTextView in an NSScrollView since it does not scroll itself, handling optional textStorage, and mapping selectedRange to the selectedRanges array. Check each feature against the capability gap type: architectural, API-level, or TextKit stack-level.

NSTextView vs UITextView: which text features are platform-exclusive?▼

AppKit-only features include text tables, formatting panels, grammar checking, Services menu, and direct RTF I/O. UIKit-only features include UITextInteraction, UITextItem context menus, UITextSelectionDisplayInteraction, UITextLoupeSession, and declarative dataDetectorTypes.

Does Writing Tools work on both NSTextView and UITextView?▼

Writing Tools works on both platforms as of iOS 18 and macOS 15, requiring TextKit 2 for the inline experience. Custom views use different coordinator types: UIWritingToolsCoordinator attached via addInteraction on iOS, and NSWritingToolsCoordinator assigned as a property on macOS.

Why did my UITextView silently fall back to TextKit 1?▼

UIKit falls back to TextKit 1 when code accesses legacy APIs; detect it by checking whether textLayoutManager is nil. Set a symbolic breakpoint on _UITextViewEnablingCompatibilityMode to find the offending call, since the fallback is permanent for that view instance.

Can NSTextView scroll on its own like UITextView?▼

No, NSTextView is not a scroll view and must be embedded in an NSScrollView, typically via NSTextView.scrollableTextView(). UITextView inherits from UIScrollView directly, so porting code that just sets a frame produces a non-scrolling, clipping text view on macOS.