VSStringComposing 0.2.1

VSStringComposing 0.2.1

TestsTested
LangLanguage Obj-CObjective C
License MIT
ReleasedLast Release Dec 2014

Maintained by Unclaimed.



  • By
  • Vladimir Shevchenko

VSStringComposing is a simple set of Objective-C categories which allows you easily compose NSString objects.

Installation

Manually

  • Drag the VSComposing folder into your project.
  • Import <VSStringComposing/NSString+VSComposing.h> or <VSStringComposing/NSArray+VSComposing.h> headers

Example Usage

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.