What problem does it solve?
Bidirectional text rendering and cursor behavior in editors can be challenging when handling RTL languages and mixed-direction content. This skill provides guidance on how to correctly manage writing directions across platforms (SwiftUI, AppKit, UIKit) and text APIs to ensure accurate display and interaction for Arabic, Hebrew, and mixed scripts.
Core Features & Use Cases
- Guidance on configuring and using writing direction controls at multiple layers: SwiftUI layoutDirection, NSParagraphStyle.baseWritingDirection, and .writingDirection attributes on attributed strings.
- Examples for precise cursor movement, selection handling, and dynamic direction updates in iOS 26 with AttributedString.
- Real-world scenarios including RTL UI components, mixed-direction paragraphs, and phone-number-like sequences that require preserved digit order.
Quick Start
Ask how to implement robust RTL support across a UITextView by setting baseWritingDirection, applying .writingDirection attributes, and opting into dynamic direction handling where available.