Skip to content

Instantly share code, notes, and snippets.

@akuraru
Last active August 29, 2015 14:08
Show Gist options
  • Save akuraru/b313921b1ab021f7da2d to your computer and use it in GitHub Desktop.
Save akuraru/b313921b1ab021f7da2d to your computer and use it in GitHub Desktop.
SwiftでperformSelectorを使うための何か
#import "NSObject+performSelector.h"
@implementation NSObject (performSelector)
- (void)call:(NSString *)sel {
[self performSelector:@selector(sel)];
}
- (id)get:(NSString *)sel {
return [self performSelector:@selector(sel)];
}
- (void)call:(NSString *)sel withObject:(id)obj1 {
[self performSelector:@selector(sel) withObject:obj1];
}
- (id)get:(NSString *)sel withObject:(id)obj1 {
return [self performSelector:@selector(sel) withObject:obj1];
}
- (void)call:(NSString *)sel withObject:(id)obj1 withObject:(id)obj2 {
[self performSelector:@selector(sel) withObject:obj1 withObject:obj2];
}
- (id)get:(NSString *)sel withObject:(id)obj1 withObject:(id)obj2 {
return [self performSelector:@selector(sel) withObject:obj1 withObject:obj2];
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment