Skip to content

Instantly share code, notes, and snippets.

@acerosalazar
Created October 11, 2014 15:41
Show Gist options
  • Save acerosalazar/1a93c3e4a34cdc124d55 to your computer and use it in GitHub Desktop.
Save acerosalazar/1a93c3e4a34cdc124d55 to your computer and use it in GitHub Desktop.
Forwarding methods to underlying ViewElements
#pragma mark - Runtime Methods
- (NSMethodSignature *)methodSignatureForSelector:(SEL)selector {
for(NSObject *vElem in self.viewElements) {
if([vElem respondsToSelector:selector]){
return [vElem methodSignatureForSelector:selector];
}
}
return nil;
}
- (void)forwardInvocation:(NSInvocation *)invocation {
for(NSObject *vElem in self.viewElements) {
if([vElem respondsToSelector:[invocation selector]]){
[invocation invokeWithTarget:vElem];
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment