An open API service indexing awesome lists of open source software.

https://github.com/meniny/easyattributedstring

✏️ Make AttributedString much more easier.
https://github.com/meniny/easyattributedstring

attributedstring nsattributedstring rich-text

Last synced: 2 months ago
JSON representation

✏️ Make AttributedString much more easier.

Awesome Lists containing this project

README

        

:name: EasyAttributedString
:author: Elias Abel
:author_esc: Elias%20Abel
:mail: [email protected]
:desc: a tool kit makes AttributedString much more easier.
:icon: {name}.png
:version: 1.1.0
:na: N/A
:ios: 8.0
:macos: 10.10
:watchos: 2.0
:tvos: 9.0
:linux: {na}
:xcode: 10.2
:swift: 5
:license: MIT
:sep: %20%7C%20
:platform: iOS{sep}macOS{sep}watchOS{sep}tvOS
// :toc: left
:toclevels: 6
:toc-title: TOC
:source-highlighter: highlightjs
// :source-highlighter: pygments
= Meet `{name}`
{author} <{mail}>
v{version}, 2018-06-04

[subs="attributes"]
++++


{name}



Author
EMail
MIT


Version
Platforms
Swift


Build Passing
Cocoapods
Carthage
SPM


++++

:toc:

== 🏵 Introduction

**{name}** is {desc}.

== 📋 Requirements

[%header]
|===
2+^m|Type 1+^m|Requirement

1.5+^.^|Platform ^|iOS ^|{ios}+
^|macOS ^|{macos}
^|tvOS ^|{tvos}
^|watchOS ^|{watchos}
^|Linux ^|{linux}

^|IDE ^|Xcode ^| {xcode}+
^|Language ^|Swift ^| {swift}+
|===

== 📲 Installation

=== CocoaPods

`{name}` is available on link:https://cocoapods.org[CocoaPods].

[source, ruby, subs="verbatim,attributes"]
----
use_frameworks!
pod '{name}'
----

=== Manually

Copy all files in the `{name}` directory into your project.

== 🛌 Dependency

{na}

== ❤️ Contribution

You are welcome to fork and submit pull requests.

== 🔖 License

`{name}` is open-sourced software, licensed under the link:./LICENSE.md[`{license}`] license.

== 🔫 Usage

[source, swift, subs="verbatim,attributes"]
----
import {name}

let style = EAStyle {
$0.font = EASystemFonts.AmericanTypewriter.font(size: 25)
$0.color = #colorLiteral(red:0.99, green:0.44, blue:0.29, alpha:1.00)
$0.underline = (.patternDot, #colorLiteral(red:0.21, green:0.84, blue:0.98, alpha:1.00))
$0.alignment = .center
}
// et voilà!
let attributedText = "Hello World!".set(style: style)
----

[source, swift, subs="verbatim,attributes"]
----
import {name}

let myStyle = EAStyle {
// define attributes...
}
EAStyleManager.shared.register("SomeStyle", style: style)

let label = UILabel.init()
label.styleName = "SomeStyle"
label.styledText = "Hello, World!"
----

[source, swift, subs="verbatim,attributes"]
----
import {name}

let normal = EAStyle {
$0.font = EASystemFonts.Helvetica_Light.font(size: 15)
}
let red = normal.byAdding {
$0.color = #colorLiteral(red:0.80, green:0.20, blue:0.20, alpha:1.00)
}
----