Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. iOS
  3. Attributed

Attributed

MITSwift3.1.0

A Swift µframework providing a fluent, strongly typed, and safe API for creating and manipulating NSAttributedString instances.

GitHubGitHub
750 stars35 forks0 contributors

What is Attributed?

Attributed is a Swift µframework that provides a fluent, strongly typed, and safe API for creating and manipulating NSAttributedString instances. It solves the problem of NSAttributedString's error-prone dictionary-based interface by offering compile-time safety and a more intuitive syntax for styling text in iOS and macOS apps.

Target Audience

iOS and macOS developers working with styled text who want a safer and more expressive alternative to the standard NSAttributedString API, particularly those using Swift.

Value Proposition

Developers choose Attributed because it eliminates runtime crashes from incorrect attribute keys, reduces boilerplate with a fluent API, and integrates seamlessly with existing NSAttributedString workflows while being lightweight and focused.

Overview

µframework for Attributed strings.

Use Cases

Best For

  • Building styled text interfaces in Swift-based iOS apps
  • Replacing error-prone NSAttributedString dictionary usage with type-safe code
  • Creating complex attributed strings with multiple styles and ranges
  • Combining multiple attributed string segments with different attributes
  • Improving code readability and safety in text-heavy UIKit or AppKit projects
  • Migrating legacy Objective-C attributed string code to modern Swift

Not Ideal For

  • Projects exclusively using SwiftUI, where Text modifiers are the standard for styling.
  • Objective-C codebases without Swift integration, as Attributed is Swift-only.
  • Applications requiring text styling on platforms other than iOS or macOS.
  • Simple apps with minimal attributed string usage where the overhead of a new framework isn't justified.

Pros & Cons

Pros

Type-Safe Interface

Prevents runtime crashes by replacing error-prone [String: Any] dictionaries with compile-time checked attributes, as emphasized in the README for safety.

Fluent API Design

Enables method chaining for readable and concise attributed string creation, reducing boilerplate compared to standard NSAttributedString APIs.

Easy Concatenation

Provides a + operator to combine NSAttributedString instances, simplifying assembly of complex styled texts without manual range management.

Closure-Based Styling

Supports creating attributed strings through closures for inline and reusable attribute definitions, enhancing code organization and reusability.

Cons

Limited Attribute Coverage

The README acknowledges users might need to request missing features, indicating not all NSAttributedString attributes are supported out of the box, requiring extensions for niche cases.

External Dependency Overhead

Adds a framework dependency via CocoaPods or Carthage for functionality that native NSAttributedString can provide, which may be unnecessary for minimalist projects or those avoiding third-party libs.

Swift Version Constraints

Requires Swift 4.0+ and Xcode 9.0, which could hinder adoption in legacy projects stuck on older Swift versions or tools.

Frequently Asked Questions

Quick Stats

Stars750
Forks35
Contributors0
Open Issues2
Last commit3 years ago
CreatedSince 2016

Tags

#ios#appkit#nsattributedstring#text-styling#type-safe#swift#attributedstring#string-manipulation#macos#uikit

Built With

S
Swift

Included in

iOS51.7kSwift26.0k
Auto-fetched 1 day ago

Related Projects

YYTextYYText

Powerful text framework for iOS to display and edit rich text.

Stars8,875
Forks1,826
Last commit1 year ago
PhoneNumberKitPhoneNumberKit

A Swift framework for parsing, formatting and validating international phone numbers. Inspired by Google's libphonenumber.

Stars5,376
Forks859
Last commit6 days ago
ZSSRichTextEditorZSSRichTextEditor

A beautiful rich text WYSIWYG editor for iOS with a syntax highlighted source view

Stars3,785
Forks589
Last commit4 years ago
BonMotBonMot

Beautiful, easy attributed strings in Swift

Stars3,557
Forks195
Last commit1 year ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub