Created
October 11, 2014 15:41
-
-
Save acerosalazar/1a93c3e4a34cdc124d55 to your computer and use it in GitHub Desktop.
Forwarding methods to underlying ViewElements
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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