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.
- Host: GitHub
- URL: https://github.com/meniny/easyattributedstring
- Owner: Meniny
- License: mit
- Created: 2018-06-04T08:53:46.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-04-11T15:34:11.000Z (about 6 years ago)
- Last Synced: 2025-01-20T08:29:15.383Z (4 months ago)
- Topics: attributedstring, nsattributedstring, rich-text
- Language: Swift
- Homepage:
- Size: 18.3 MB
- Stars: 3
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.adoc
- License: LICENSE.md
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"]
++++
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
++++:toc:
== 🏵 Introduction
**{name}** is {desc}.
== 📋 Requirements
[%header]
|===
2+^m|Type 1+^m|Requirement1.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)
}
----