Skip to content

Instantly share code, notes, and snippets.

@brentsimmons
Created June 22, 2012 23:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brentsimmons/2975795 to your computer and use it in GitHub Desktop.
Save brentsimmons/2975795 to your computer and use it in GitHub Desktop.
Category method for UIResponder to perform a selector via responder chain
@implementation UIResponder (RSCore)
- (BOOL)rs_performSelectorViaResponderChain:(SEL)aSelector withObject:(id)anObject {
UIResponder *nomad = self;
while (nomad != nil) {
if ([nomad respondsToSelector:aSelector]) {
[nomad performSelector:aSelector withObject:anObject];
return YES;
}
nomad = [nomad nextResponder];
}
return NO;
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment