Attributed alternatives and similar libraries
Based on the "Text" category.
Alternatively, view Attributed alternatives based on common mentions on social networks and blogs.
-
YYText
Powerful text framework for iOS to display and edit rich text. -
Nimbus
The iOS framework that grows only as fast as its documentation -
PhoneNumberKit
A Swift framework for parsing, formatting and validating international phone numbers. Inspired by Google's libphonenumber. -
ZSSRichTextEditor
A beautiful rich text WYSIWYG editor for iOS with a syntax highlighted source view -
Twitter Text Obj
Twitter Text Libraries. This code is used at Twitter to tokenize and parse text to meet the expectations for what can be used on the platform. -
FontAwesomeKit
Icon font library for iOS. Currently supports Font-Awesome, Foundation icons, Zocial, and ionicons. -
SwiftRichString
👩🎨 Elegant Attributed String composition in Swift sauce -
libPhoneNumber-iOS
iOS port from libphonenumber (Google's phone number handling library) -
TwitterTextEditor
A standalone, flexible API that provides a full-featured rich text editor for iOS applications. -
Down
Blazing fast Markdown / CommonMark rendering in Swift, built upon cmark. -
RichEditorView
RichEditorView is a simple, modular, drop-in UIView subclass for Rich Text Editing. -
SwiftyMarkdown
Converts Markdown files and strings into NSAttributedStrings with lots of customisation options. -
SwiftString
A comprehensive, lightweight string extension for Swift -
Iconic
:art: Auto-generated icon font library for iOS, watchOS and tvOS -
MMMarkdown
An Objective-C framework for converting Markdown to HTML. -
Atributika
Convert text with HTML tags, links, hashtags, mentions into NSAttributedString. Make them clickable with UILabel drop-in replacement. -
CocoaMarkdown
Markdown parsing and rendering for iOS and OS X -
SwiftIconFont
Icons fonts for iOS (Font Awesome 5, Iconic, Ionicon, Octicon, Themify, MapIcon, MaterialIcon, Foundation 3, Elegant Icon, Captain Icon) -
FontBlaster
Programmatically load custom fonts into your iOS, macOS and tvOS app. -
Notepad
[iOS] A fully themeable markdown editor with live syntax highlighting. -
MarkdownKit
A simple and customizable Markdown Parser for Swift -
fuse-swift
A lightweight fuzzy-search library, with zero dependencies -
FormatterKit
stringWithFormat: for the sophisticated hacker set -
AztecEditor-iOS
A reusable native iOS visual HTML text editor component. -
NSStringEmojize
A category on NSString to convert Emoji Cheat Sheet codes to their equivalent Unicode characters -
Guitar
A Cross-Platform String and Regular Expression Library written in Swift. -
Mustard
🌭 Mustard is a Swift library for tokenizing strings when splitting by whitespace doesn't cut it. -
Translucid
Lightweight library to set an Image as text background. Written in swift. -
GoogleMaterialDesignIcons
Google Material Design Icons Font for iOS -
Heimdall
Heimdall is a wrapper around the Security framework for simple encryption/decryption operations. -
AttributedTextView
Easiest way to create an attributed UITextView (with support for multiple links and from html)
InfluxDB - Power Real-Time Data Analytics at Scale
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of Attributed or a related project?
README
Attributed
µframework for Attributed strings.
What is Attributed?
Attributed aims to be a drop in replacement to the current version of the NSAttributedString
API.
The NSAttributedString
interface has a few shortcomings. If you donʼt know the key and type of value needed to set a certain attribute, you have to spend time checking documentation. Another concern is safety: passing a dictionary of type [String: Any]
to the constructor of NSAttributedString
is a potential crash at runtime waiting to happen.
Attributed provides developers a nicer alternative by extending the current NSAttributedString
interface with a fluent, strongly typed, and easy to use API.
Features
- [x] Create
NSAttributedString
instances with a strongly typed, simple, and fluid interface - [x] Combine
NSAttributedString
s with+
- [x] Partially apply Attributes to parts of an
NSAttributedString
by providing aRange
Donʼt see a feature you need?
Feel free to open an issue requesting the feature you want or send over a pull request!
Usage
Creating a new NSAttributedString
by closure composition
"This is not a string".at.attributed {
return $0.foreground(color: .red)
.font(UIFont(name: "Chalkduster", size: 24.0)!)
.underlineStyle(.styleSingle)
}
Creating a new NSAttributedString
by passing an attributes object
First create an Attributes
object:
let attributes = Attributes {
return $0.foreground(color: .red)
.font(UIFont(name: "Chalkduster", size: 24.0)!)
.underlineStyle(.styleSingle)
}
then simply apply the Attributes
to a String
:
"Hello".at.attributed(with: attributes)
Combining NSAttributedString
with +
This library defines an concatenation operator +
for concatentating instances of NSAttributedString
.
+
works with NSAttributedString
no different than it does for String
.
This can be useful for combining NSAttributedStrings
with different attributes to produce the
desired effect without having to specify ranges to apply different attributes to.
let bodyAttributes = Attributes {
return $0.foreground(color: .purple)
.font(UIFont(name: "Noteworthy-Light", size: 20.0)!)
}
let authorAttributes = bodyAttributes.foreground(color: .black)
"I think theres something strangely musical about noise.".at.attributed(with: bodyAttributes)
+ "\n - Trent Reznor".at.attributed(with: authorAttributes)
Installation
Carthage
If you use Carthage to manage your dependencies, simply add
Attributed to your Cartfile
:
github "Nirma/Attributed"
If you use Carthage to build your dependencies, make sure you have added Attributed.framework
to the "Linked Frameworks and Libraries" section of your target, and have included Attributed.framework
in your Carthage framework copying build phase.
CocoaPods
If you use CocoaPods to manage your dependencies, simply add
Attributed to your Podfile
:
pod 'AttributedLib'
Requirements
- Xcode 9.0
- Swift 4.0+
Contribution
Contributions are more than welcome!
License
Attributed is free software, and may be redistributed under the terms specified in the LICENSE file.
*Note that all licence references and agreements mentioned in the Attributed README section above
are relevant to that project's source code only.