TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | MIT |
ReleasedLast Release | Jul 2016 |
Maintained by carlSQ.
when obejct init ,you shuold register
- (void)viewDidLoad {
[super viewDidLoad];
@FKCOUPLING(self);
}
send message to register object
[FKCoupling handleCoupling:@protocol(FKTestProtocol) selector:@selector(testProtocol:) args:@[@"fuck "]];
[FKCoupling handleCoupling:@protocol(FKTestProtocol) selector:@selector(testProtocolCount:) args:@[@(100)]];
find register object and do something
[FKCoupling handleCoupling:@protocol(FKTestProtocol) execute:^(id<FKTestProtocol> couplingObject) {
if ([couplingObject respondsToSelector:@selector(testProtocol:)]) {
[couplingObject testProtocol:@"test"];
}
if ([couplingObject respondsToSelector:@selector(testProtocolCount:)]) {
[couplingObject testProtocolCount:8888];
}
}];
only need protocal name,method,args, no dependence
[FKCoupling handleCouplingWithProtocolName:@"FKTestProtocol" selectorName:@"testProtocolCount:" args:@[@(100)]];
[FKCoupling handleCouplingWithProtocolName:@"FKTestProtocol" selectorName:@"testProtocol:" args:@[@"fuck"]];
FKCoupling is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "FKCoupling"
carl shen
FKCoupling is available under the MIT license. See the LICENSE file for more info.