Install any skill in seconds. Free to start, no credit card required.
Get Started Free →rshankras/text-editing
Styled text display and rich text editing in SwiftUI using Text, AttributedString, and TextEditor with formatting controls.
Passed 24 of 24 test cases with the skill, and 17 of 24 without it.
and 7 more in the full report
7 fixed17 passed either way0 still failing0 broke
Tokens, turns and time describe resource use, not a dollar price.
One of 7 test cases the skill fixed. Same model, same prompt, with and without the skill.
I need to restrict a SwiftUI `TextEditor` so that font weight toggling is constrained to switching between regular and bold weights, ignoring other weights like semibold or heavy. What iOS 18 protocol should I implement to enforce this constraint?
| Checked | Without skill | With skill |
|---|---|---|
| Defines a struct conforming to AttributedTextFormattingDefinition | Missed | Passed |
| Applies textFormattingDefinition() modifier to TextEditor | Missed | Passed |
The instructions your model reads when the skill loads.
Patterns for displaying styled text and building rich text editors in SwiftUI. Covers Text styling, AttributedString, TextEditor with selection-based formatting, and custom formatting definitions.
Use this skill when the user:
What text feature do you need?
|
+- Display styled read-only text
| +- Simple styling (one style) -> Text Styling section below
| +- Mixed styles in one string -> AttributedString section below
| +- Markdown content -> Markdown section below
|
+- Edit plain text
| +- TextEditor(text: $stringBinding)
|
+- Edit rich/styled text
| +- Basic rich editor -> Rich Text Editing section below
| +- With formatting toolbar -> Formatting Controls section below
| +- With custom constraints -> Custom Formatting section below
| API | Minimum Version | Notes |
|---|---|---|
Text with modifiers | iOS 13 | .font(), .bold(), .italic() |
TextEditor(text:) | iOS 14 | Plain string binding |
test cases passed, vs 17 / 24 without
Published skills whose descriptions closely match this one, with their headline benchmark lift.
More skills from the same source and nearby in the registry, with their headline benchmark lift.