JPAttributedStringBuilder 0.1

JPAttributedStringBuilder 0.1

测试已测试
语言语言 Obj-CObjective C
许可证 MIT
发布最后发布2014年12月

James Paolantonio 维护。



创建 NSString 和 NSAttributedStrings 的 DSL

安装

使用 CocoaPods 安装

pod 'JPAttributedStringBuilder'

用法

NSAttributedString 创建

您是否曾经需要附加多个 NSAttributedStrings

NSMutableAttributedString *text = [[NSMutableAttributedString alloc] init];

[text appendAttributedString:
     [[NSAttributedString alloc] initWithString:firstName
                                     attributes:@{
                                                  NSFontAttributeName : [UIFont boldSystemFont:12.0f],
                                                  NSForegroundColorAttributeName : [UIColor blackColor]
                                                  }]];

[text appendAttributedString:
     [[NSAttributedString alloc] initWithString:[NSString stringWithFormat:@"%@\n", self.search.neighborhoodsString]
                                     attributes:@{
                                                  NSFontAttributeName : [UIFont proximaNovaBoldWithSize:16.0f],
                                                  NSForegroundColorAttributeName : [UIColor ucDarkColor]
                                                  }]];

[text appendAttributedString:
     [[NSAttributedString alloc] initWithString:[NSString stringWithFormat:@"%@", self.bedPriceString]
                                     attributes:@{
                                                  NSFontAttributeName : [UIFont proximaNovaRegularWithSize:14.0f],
                                                  NSForegroundColorAttributeName : [UIColor ucDarkColor]
                                                  }]];

例子

项目中包含一个例子。要安装,

$ pod install
$ open ZipLocateSample.xcworkspace/

贡献

给我发送拉取请求!

作者

James Paolantonio - @jpaolantonio

附加信息

如果你使用它或在某处需要改变什么,告诉我吧!! :)