Latest 0.1.0
Homepage https://github.com/Iterar/ITActionManager
License MIT
Authors

Method dispatcher and progress handler.

Installation with CocoaPods (Podfile)

pod "ITActionManager"

Manual installation

Copy "ITActionManager" (and "NSInvocation+SimpleCreation" if you want to use the helper methods to build NSInvocation’s) to your project and import when you want to use them.

#import "ITActionManager.h"
#import "NSInvocation+SimpleCreation.h"

Example

// Invocations
NSInvocation *inv = [ITActionManager invocationWithTarget:yourTarget andSelector:@selector(yourSelector:)];
NSInvocation *inv2 = [ITActionManager invocationWithTarget:yourTarget2 andSelector:@selector(yourSelector2:)];
// Action manager
ITActionManager *actionManager = [[ITActionManager alloc] init];
[actionManager addActionsProgressHandler:^(float percentProgress) {
    NSLog(@"Progress - %f", percentProgress);
}];
[actionManager addActionsResultHandler:^(float result) {
    NSLog(@"Completed.");
}];
[actionManager performMethods:@[inv, inv2]];

Inspired by Sebastien Windal on Callback handlers using blocks

Latest podspec

{
    "name": "ITActionManager",
    "version": "0.1.0",
    "license": "MIT",
    "summary": "Method dispatcher and progress handler.",
    "homepage": "https://github.com/Iterar/ITActionManager",
    "authors": {
        "Tiago Alves": "[email protected]"
    },
    "source": {
        "git": "https://github.com/Iterar/ITActionManager.git",
        "tag": "0.1.0"
    },
    "requires_arc": true,
    "source_files": [
        "ITActionManager/**/*.{h,m}",
        "NSInvocation+SimpleCreation/**/*.{h,m}"
    ]
}

Pin It on Pinterest

Share This