ITActionManager 0.1.0

ITActionManager 0.1.0

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

Maintained by Unclaimed.



  • By
  • Tiago Alves

Method dispatcher and progress handler.

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