

因为在使用 NSAttributedString 的过程中感觉非常的不方便,所以一年前写了这么一个框架 Typeset 来快速生成 NSAttributedString

使用如下的语法
@"Hello'.red.fontSize(20); 同样也支持对 UILabel 设置样式, 可以在 typesetBlock 中对字符串预先进行匹配,
如下:如果出现了 @"type" 就会把 @"type" 变成紫色,出现了 @"set" 就会变为蓝色
label.typesetBlock = TSBlock(fontSize(40) .match(@"type").purple .match(@"set").blue); label.text = @"Hello typeset, hello."; 觉得有用的朋友可以点个 star https://github.com/Draveness/Typeset
1 mthli 2016 年 4 月 17 日 via Android 支持! |
2 canaan 2016 年 4 月 17 日 遭不住了,这么优秀。 |
3 silencewwt 2016 年 4 月 17 日 惊了个呆 看见头像我就滚进来了 |
4 ahmiao 2016 年 4 月 17 日 正好今天还看到这个: https://github.com/delba/TextAttributes |
5 xi_lin 2016 年 4 月 17 日 赞,好想法! |
8 yautou 2016 年 4 月 17 日 模拟器实时生效预览效果是什么插件吗? |
9 airdrop 2016 年 4 月 17 日 同问模拟器实时运行是怎么实现的 |
10 yoa1q7y 2016 年 4 月 17 日 |
11 nathanw 2016 年 4 月 17 日 https://github.com/delba/TextAttributes 和这相比有什么不同之处么? |
13 PopeyeLau 2016 年 4 月 25 日 木有 swift 版么. |