Swiftpack.co - Nemocdz/EasyText as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by Nemocdz.
Nemocdz/EasyText 1.0.0
Easy way to create a NSAttributedString in Swift 5
⭐️ 17
🕓 4 years ago
iOS macOS
.package(url: "https://github.com/Nemocdz/EasyText.git", from: "1.0.0")

EasyText

CI Status Version License Platform

EasyText is library written in Swift, which provide an easy and safe way to create a NSAttributedString.It use StringInterpolation in Swift 5.

Features

  • ☑ Type safe
  • ☑ Support multiple platfoms, iOS and macOS
  • ☑ Support most of NSAttributedString.Key
  • ☑ Support usual operators, such as +,+=
  • ☑ Support UIImage/NSImage

Example

let text:EasyText = "\("font is 30 pt and color is yellow", .font(.systemFont(ofSize: 20)), .color(.blue))"

textView.attributedText = text.attributedString

More examples in Example/iOS.

Requirements

  • iOS 9.0+/macOS 10.11+

  • Swift 5.0+

Installation

Cocoapods

pod 'EasyText','~> 1.0.0'

Carthage

github "Nemocdz/EasyText" "1.0.0"

Swift Package Manager

dependencies: [
    .package(url: "https://github.com/Nemocdz/EasyText.git", from: "1.0.0")
]

Article

使用 Swift 5 字符串插值快速构建 AttributeString

Author

Nemocdz, [email protected]

License

EasyText is available under the MIT license. See the LICENSE file for more info.

GitHub

link
Stars: 17
Last commit: 4 years ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics