attributed-string
AttributedString patterns for rich text formatting, alignment, selection, and SwiftUI integration. Use when working with styled text, text editing, or AttributedString APIs.
Profile →npx skills add rshankras/claude-code-apple-skills --skill attributed-string --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# AttributedString Patterns Correct API shapes and patterns for Foundation's `AttributedString`. Covers creating styled text, applying attributes to ranges, text alignment, writing direction, line height control, text selection and editing, discontiguous substrings, and SwiftUI integration. ## When This Skill Activates Use this skill when the user: - Asks about **AttributedString** creation or manipulation - Wants to **style text** with fonts, colors, underlines, or other attributes - Mentions **text alignment**, **writing direction**, or **line height** - Asks about **text selection** or **text editing** with AttributedString - Wants to work with **DiscontiguousAttributedSubstring** or **RangeSet** - Mentions **TextEditor** with **AttributedString** in SwiftUI - Asks about **rich text** formatting in Swift - Wants to **replace** or **modify** text within an AttributedString - Mentions **paragraphStyle**, **textSelectionAffinity**, or **AttributedTextSelection** ## Decision Tree ``` What do you need with AttributedString? | +-- Create or style text | | | +-- Simple inline attributes (font, color) | | --> Creating and Styling section | | | +-- Paragraph-level formatting (alignment,
- When This Skill Activates
- Decision Tree
- API Availability
- Top 5 Mistakes
- Creating and Styling
- Basic Initialization
- Applying Attributes to Ranges
- Creating from a Substring
- Text Alignment and Formatting
- Legacy Approach (iOS 15+)
- Modern Approach (iOS 26+)
- Writing Direction and Line Height
- Writing Direction (iOS 26+)
- Line Height (iOS 26+)
What does the attributed-string skill do?
AttributedString patterns for rich text formatting, alignment, selection, and SwiftUI integration. Use when working with styled text, text editing, or AttributedString APIs.
How do I install it?
Run `npx skills add rshankras/claude-code-apple-skills --skill attributed-string --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From rshankras/claude-code-apple-skills, a repository with 589 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.