iOS 多delegate,多代理,多委托实现方案
pod 'TKMultipleDelegate'
@property(nonatomic, strong) TKMultipleDelegate<Protocol1,Protocol2,Protocol3> *delegates;//Multiple Delegate
self.delegates = [[TKMultipleDelegate<Protocol1,Protocol2,Protocol3> alloc] init];
[self.delegates addDelegate:delegate1];
[self.delegates addDelegate:delegate2];
[self.delegates addDelegate:delegate3];
//add more delegate
if ([self.delegates respondsToSelector:@selector(call)]) {
[self.delegates call];
}
sayaDev, [email protected]
TKMultipleDelegate is available under the MIT license. See the LICENSE file for more info.