From a55f9b424b3f6011a0caff905826326bc01ebd0e Mon Sep 17 00:00:00 2001 From: Ethan Huang Date: Thu, 11 Jul 2019 23:12:43 +0800 Subject: [PATCH] [Changed] README.md --- README.md | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 8bd1771..bfbe81f 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,25 @@ # NSAttributedStringBuilder -Composing `NSAttributedString` with SwiftUI-style syntax. +[![Build Status](https://travis-ci.org/ethanhuang13/NSAttributedStringBuilder.svg?branch=master)](https://travis-ci.org/ethanhuang13/NSAttributedStringBuilder) +[![GitHub release](https://img.shields.io/github/release/ethanhuang13/nsattributedstringbuilder.svg)]() +![GitHub top language](https://img.shields.io/github/languages/top/ethanhuang13/nsattributedstringbuilder.svg) +[![License](https://img.shields.io/github/license/ethanhuang13/nsattributedstringbuilder.svg)](https://github.com/ethanhuang13/ladybug/blob/master/LICENSE) +[![Twitter](https://img.shields.io/badge/Twitter-%40ethanhuang13-blue.svg)](https://twitter.com/ethanhuang13) +[![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://paypal.me/ethanhuang13) -**NSAttributedStringBuilder** is a `NSAttributedString` syntax helper powerd by the now pitching [Function Builder](https://forums.swift.org/t/function-builders/25167). +Composing `NSAttributedString` with SwiftUI-style syntax, powerd by the now pitching [Function Builder](https://forums.swift.org/t/function-builders/25167). Project Link: [https://github.com/ethanhuang13/NSAttributedStringBuilder](https://github.com/ethanhuang13/NSAttributedStringBuilder) +## Features + +| | Features | +| --- | --- | +| ๐Ÿฆ | Open source library written in Swift 5 | +| ๐Ÿฌ | SwiftUI-like syntax | +| ๐Ÿ’ช | Support most attributes in `NSAttributedString.Key` | +| ๐Ÿ“ฆ | Distribution with Swift Package Manager | +| ๐Ÿงช | Fully tested code | + ## How to use? Traditionally we compose a `NSAttributedString` like this: @@ -30,15 +45,6 @@ let attributedString = NSAttributedString { } ``` -## Features - -| | Features | -| --- | --- | -| ๐Ÿฆ | Open source library written in Swift 5 | -| ๐Ÿฌ | SwiftUI-like syntax | -| ๐Ÿ’ช | Support most attributes in `NSAttributedString.Key` | -| ๐Ÿ“ฆ | Distribution with Swift Package Manager | -| ๐Ÿงช | Fully tested code | ## Requirement **NSAttributedStringBuilder** requires iOS 13, macOS 10.15, tvOS 13, or watchOS 13, because it uses Swift 5.1 features like [Function Builder](https://forums.swift.org/t/function-builders/25167). @@ -63,7 +69,7 @@ Then use `AttributedText` will be like: You can clone the [repo](https://github.com/ethanhuang13/NSAttributedStringBuilder) and open ***/SwiftUISampleApp/AttributedTextSample.xcodeproj***. The sample uses `UITextView`, you can also use `UILabel` or `NSTextView`. ## TODO -* Tests pass for image attachment +* Better tests for image attachment ## Known Issue * `NSAttributedString` does not support link color, therefore `Link` component with a `.color()` modifier has no effect. Alternatively you need to specify in `UITextView.linkTextAttributes` or `.tintColor`.