Latest 0.2.1
Homepage https://github.com/Volodymyr/VSComposing
License MIT
Authors

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

Installation

From CocoaPods

Add pod 'VSStringComposing' to your Podfile.

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.

Latest podspec

{
    "name": "VSStringComposing",
    "version": "0.2.1",
    "summary": "VSStringComposing is a simple category of NSString which allows you easily compose NSString objects.",
    "homepage": "https://github.com/Volodymyr/VSComposing",
    "license": "MIT",
    "authors": {
        "Vladimir Shevchenko": "[email protected]"
    },
    "source": {
        "git": "https://github.com/Volodymyr/VSComposing.git",
        "tag": "0.2.1"
    },
    "source_files": [
        "VSComposing",
        "VSComposing/**/*.{h,m}"
    ],
    "requires_arc": true
}

Pin It on Pinterest

Share This