Increase version to 1.0.2 in podspec
Small framework for easily applying attributes to NSAttributedString.
.Package(url: "https://github.com/magyarosibotond/AttributedStringTag.git", majorVersion: 1)
pod 'AttributedStringTag'
github "magyarosibotond/AttributedStringTag"
AttributedStringTag provides two extensions to manipulate your NSAttributedStrings.
You can initialize with a given string and attributes:
let text = "Welcome back <b>John, <c>Logout</c></b>" label.attributedText = NSAttributedString(string: text, applyintAttributesForTag: ["b": [NSAttributedString.Key.font: UIFont.boldSystemFont(ofSize: 15)], "c": [NSAttributedString.Key.foregroundColor: UIColor.red]])
You can also use NSMutableAttributedString and mutate the text afterwards:
let text = "Welcome back <b>John, <c>Logout</c></b>" label.attributedText = NSMutableAttributedString(string: text) .setAttributes([NSAttributedString.Key.font: UIFont.boldSystemFont(ofSize: 15)], forTag: "b") .setAttributes([NSAttributedString.Key.foregroundColor: UIColor.red], forTag: "c")
AttributedStringTag is released under the MIT license. See LICENSE for details.
版权所有:中国计算机学会技术支持:开源发展技术委员会 京ICP备13000930号-9 京公网安备 11010802032778号
🖍 AttributedStringTag
About
Small framework for easily applying attributes to NSAttributedString.
Requirements
Features
Installation Instructions
Swift Package Manager
CocoaPods
Carthage
Usage
AttributedStringTag provides two extensions to manipulate your NSAttributedStrings.
You can initialize with a given string and attributes:
You can also use NSMutableAttributedString and mutate the text afterwards:
License
AttributedStringTag is released under the MIT license. See LICENSE for details.