SHInvocation 0.9.3

SHInvocation 0.9.3

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

Maintained by Seivan Heidari.



  • By
  • Seivan Heidari

This pod is used by SHFoundationAdditions as part of several components improving Foundation, UIKit, CoreLocation, GameKit, MapKit and other aspects of an iOS application's architecture

Overview

SHInvocation is a category on top of NSInvocation to allow executing selectors with multiple

Installation

pod 'SHInvocation'

Setup

Put this either in specific classes or your project prefix file

#import "NSInvocation+SHInvocation.h"

or

#import "SHInvocation.h"

API

+(BOOL)SH_performInvocationOnTarget:(id)theTarget
                       withSelector:(SEL)theSelector
                       andArguments:(NSArray *)theArguments;

USAGE

  NSString * firstArgument  = @"My first Argument";
  NSArray  * secondArgument = @[firstArgument, firstArgument, firstArgument];

 BOOL didInvoke = [NSInvocation SH_performInvocationOnTarget:self 
                                                withSelector:@selector(passTheFirstArgument:passTheSecondArgument:) 
                                                andArguments:@[firstArgument, secondArgument]];

  NSParameterAssert(didInvoke);
  NSParameterAssert([self.firstArgument  isEqualToString:firstArgument]);
  NSParameterAssert([self.secondArgument isEqual:secondArgument]);

Contact

If you end up using SHInvocation in a project, I'd love to hear about it.

email: [email protected]
twitter: @seivanheidari

License

SHInvocation is © 2013 Seivan and may be freely distributed under the MIT license. See the LICENSE.md file.