A Swifty API for attributed strings in iOS, macOS, watchOS, and tvOS with a clean, chainable syntax.
SwiftyAttributes is a Swift library that provides a modern, type-safe API for creating and manipulating attributed strings on Apple platforms. It solves the problem of verbose and error-prone Foundation APIs by offering a chainable syntax and comprehensive enum-based attribute system. Developers can style text with attributes like colors, fonts, and underlines using clean, Swifty code.
iOS, macOS, watchOS, and tvOS developers who need to work with styled text in their apps, particularly those building rich text editors, custom UI components, or localized interfaces with mixed formatting.
Developers choose SwiftyAttributes because it replaces Objective-C's cumbersome `NSAttributedString` APIs with a native Swift experience—offering type safety, chainable methods, and Swift Range support. It eliminates stringly-typed keys while maintaining full compatibility with all Cocoa attributes.
A Swifty API for attributed strings
Enables readable, fluid code like 'Hello World!'.withTextColor(.blue).withUnderlineStyle(.styleSingle), reducing verbosity compared to Foundation APIs.
Uses an enum for all attributes, such as .underlineStyle(.styleSingle), eliminating stringly-typed keys and reducing runtime errors.
Works with Swift's Range<Int> instead of NSRange, making it better integrated with Swift collections and avoiding manual conversions.
Supports every attribute available in Cocoa and Cocoa Touch, ensuring full compatibility for any attributed string use case.
Limited to Apple platforms (iOS, macOS, etc.), so it's unsuitable for cross-platform projects or those using non-Apple technologies.
Adds an external library for functionality that Foundation provides natively, which can be unnecessary for simple apps and increase maintenance.
Designed for UIKit/AppKit, so using it with SwiftUI requires additional bridging or workarounds, complicating the codebase.
Powerful text framework for iOS to display and edit rich text.
A Swift framework for parsing, formatting and validating international phone numbers. Inspired by Google's libphonenumber.
A beautiful rich text WYSIWYG editor for iOS with a syntax highlighted source view
Beautiful, easy attributed strings in Swift
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.