TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | MIT |
ReleasedLast Release | Dec 2014 |
Maintained by James Paolantonio.
A DSL for creating NSStrings and NSAttributedStrings
Install with CocoaPods:
pod 'JPAttributedStringBuilder'
Have you ever had to append a bunch of 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]
}]];
There is an example included with the project. To install,
$ pod install
$ open ZipLocateSample.xcworkspace/
Send me pull requests!
James Paolantonio - @jpaolantonio
Let me know if you are using this or want anything changed!! :)