VSStringComposing 0.2.1

VSStringComposing 0.2.1

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

未声明维护。



  • Vladimir Shevchenko

VSStringComposing 是一组简单的 Objective-C 分类,允许您轻松地组合 NSString 对象。

安装

手动

  • VSComposing 文件夹拖到您的项目。
  • 导入 <VSStringComposing/NSString+VSComposing.h><VSStringComposing/NSArray+VSComposing.h> 头文件

示例用法

NSString *firstName   = @"Volodymyr";
NSString *lastName    = @"Shevchenko";
NSNumber *yearOfBirth = @(1989);

NSArray *arrayToCompose = @[@"My name is ", firstName, @" ", lastName, @". I was born in ", yearOfBirth, @"."];        
NSString *composedString = [NSString composeFromArray:arrayToCompose];
NSLog(@"%@", composedString);
// result : My name is Volodymyr Shevchenko. I was born in 1989.

NSString *otherComposedString = arrayToCompose.composedContent;
NSLog(@"%@", otherComposedString);
// result : My name is Volodymyr Shevchenko. I was born in 1989.