apple-text-bidi

Configure bidirectional text handling in Apple Text editors with writing direction APIs.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

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.

Frequently Asked Questions about apple-text-bidi

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

FAQPage Schema
How do I handle bidirectional text rendering and cursor behavior in a UITextView?

To handle bidirectional text in a UITextView, you need to configure baseWritingDirection via NSParagraphStyle and apply .writingDirection attributes to ensure accurate display and interaction for mixed-direction scripts.

What is the best way to support mixed-direction paragraphs and RTL languages in SwiftUI?

Supporting mixed-direction paragraphs in SwiftUI involves configuring layoutDirection and applying .writingDirection attributes on attributed strings to correctly manage Arabic, Hebrew, and mixed scripts.

Why does my cursor movement behave incorrectly with Arabic or Hebrew text in AppKit?

Incorrect cursor movement in Arabic or Hebrew text usually occurs when baseWritingDirection is not properly set, requiring precise selection handling and dynamic direction updates via NSParagraphStyle.

Can I use AttributedString APIs to dynamically update writing direction in iOS 26?

Yes, you can use AttributedString APIs to opt into dynamic writing direction handling in iOS 26, ensuring correct display and interaction for dynamic RTL text updates.

How do I preserve digit order for phone-number-like sequences inside RTL text?

To preserve digit order for phone-number-like sequences in RTL text, you must apply specific .writingDirection attributes on your attributed strings to prevent the numbers from reversing unexpectedly.

Does configuring writing direction via UITextInput work across SwiftUI and AppKit interfaces?

Yes, configuring writing direction via UITextInput and NSParagraphStyle works across SwiftUI and AppKit/UIKit interfaces to ensure robust bidirectional text handling and accurate display.