foundation-attributed-string
CommunityPatterns for rich Swift AttributedString
Software Engineering#swift#swiftui#text-editing#rich-text#attributedstring#text-selection#paragraph-style
AuthorAutisticAF
Version1.0.0
Installs0
System Documentation
What problem does it solve?
Developers struggle to create, style, and safely mutate rich text using Foundation's AttributedString while handling version-gated APIs, paragraph formatting, selection editing, and non-contiguous ranges in Swift and SwiftUI projects. This skill consolidates correct API shapes, common pitfalls, and migration patterns so you can apply attributes, control layout, and integrate with TextEditor reliably.
Core Features & Use Cases
- Provides idiomatic examples for initializing and mutating AttributedString values while respecting value-type semantics and safe range lookups.
- Shows both legacy paragraph-style workflows and modern alignment, line-height, and writing-direction APIs with platform availability guidance.
- Explains programmatic text selection and replacement, discontiguous substring manipulation, UTF-8 access, and SwiftUI TextEditor integration for rich text editing.
- Use case: update a localized paragraph's alignment and line height, highlight multiple non-contiguous ranges, and replace the current selection with styled content while preserving selection semantics.
Quick Start
Use the foundation-attributed-string skill to convert a plain string into an AttributedString, apply font and color attributes to a specific range, set paragraph alignment, and prepare it for display or editing in SwiftUI.
Dependency Matrix
Required Modules
None requiredComponents
Standard package💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: foundation-attributed-string Download link: https://github.com/AutisticAF/claude-code-apple-dev-plugin/archive/main.zip#foundation-attributed-string Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.