Skip to content
This repository was archived by the owner on Nov 12, 2024. It is now read-only.

seivan-archives/SHInvocation

Repository files navigation

SHInvocation

CI Status Version Platform License

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: seivan.heidari@icloud.com
twitter: @seivanheidari

##License

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

About

Prefix on NSInvocation for easily invoking messages with multiple arguments.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors