Skip to content

Latest commit

 

History

History
41 lines (27 loc) · 736 Bytes

README.md

File metadata and controls

41 lines (27 loc) · 736 Bytes

How to use CDProxy

#import <UIViewController+CDObserver.h>

@implementation TableViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self cd_startObserveProtocol:@protocol(TableViewCellDelegate)];
}

- (void)didSwitch:(id)sender {

}

@end
#import "UIResponder+CDProxying.h"

@interface TableViewCell ()

@property (weak, nonatomic) id<TableViewCellDelegate> actionProxy;

@end

@implementation TableViewCell

- (void)didMoveToSuperview {
    [super didMoveToSuperview];
    self.actionProxy = (id<TableViewCellDelegate>)[self cd_proxyForProtocol:@protocol(TableViewCellDelegate)];
}

- (IBAction)switchAction:(id)sender {
    
    [self.actionProxy didSwitch:sender];
    
}

@end