Latest 0.0.1
License MIT
Platforms ios 7.0, requires ARC

Allows for asynchronous, arbitrary order, string manipulation. This library is super new and not even close to complete :) The motivation for NDDLazyString is to be able to modify atributed strings while conserving the original ranges of the text you’re modifying.


pod 'NDDLazyString', '~> 0.0'

Motivating Example

Say you would like to replace all instances of ‘:)’ with an image of a smiley.

    NSString *string = @":) hello world :) Happy Friday!";

    NSArray *ranges = nil; //get all of the ranges of :) using your preferred method. REGEX is nice :)
    NDDLazyString *lazyString = [[NDDLazyString alloc] initWithString:string];

    [lazyString beginUpdates];

    for(NSValue *value in ranges) {
        NSRange range = [value rangeValue];
        [lazyString replaceCharactersInRange:range fromLazyChangeBlock:^NSAttributedString *{
            NSAttributedString *replaceString = nil;//some attributedString to replace :) with
            return replaceString;
        } completionBlock:^(NDDLazyString *lazySring, NSError *error) {
            //do something with lazyString.attributedString

    [lazyString endUpdates];


Right now this only works asynchrounously. The motivating example would probably be better done synchrounously wih an local asset.

Future Work

Would like to parse HTML for simple text manipulations and img tags.

How to contribute

Hit me up! No plans right now to turn this into a giant project. But if you want to contribute because your project needs something like this, lmk and we can get a workflow going.

Latest podspec

    "name": "NDDLazyString",
    "version": "0.0.1",
    "summary": "Allows for asynchronous, arbitrary order, string manipulation.",
    "description": "Allows for asynchronous, arbitrary order, attributed string manipulation.",
    "homepage": "",
    "source": {
        "git": "",
        "tag": "0.0.1"
    "license": "MIT",
    "authors": {
        "keepingitneil": "[email protected]"
    "source_files": [
    "platforms": {
        "ios": "7.0"
    "requires_arc": true

Pin It on Pinterest

Share This