EasyAttributedString
Meet
🏵 Introduction
EasyAttributedString is a tool kit makes AttributedString much more easier..
📋 Requirements
Type | Requirement | |
---|---|---|
Platform |
iOS |
8.0+ |
macOS |
10.10 |
|
tvOS |
9.0 |
|
watchOS |
2.0 |
|
Linux |
N/A |
|
IDE |
Xcode |
10.2+ |
Language |
Swift |
5+ |
📲 Installation
CocoaPods
EasyAttributedString
is available on CocoaPods.
use_frameworks!
pod 'EasyAttributedString'
Manually
Copy all files in the EasyAttributedString
directory into your project.
🛌 Dependency
N/A
❤️ Contribution
You are welcome to fork and submit pull requests.
🔖 License
EasyAttributedString
is open-sourced software, licensed under the MIT
license.
🔫 Usage
import EasyAttributedString
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)
import EasyAttributedString
let myStyle = EAStyle {
// define attributes...
}
EAStyleManager.shared.register("SomeStyle", style: style)
let label = UILabel.init()
label.styleName = "SomeStyle"
label.styledText = "Hello, <red>World</red>!"
import EasyAttributedString
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)
}