/WZProtocolInterceptor

a intermediate proxy class to forward Objective-C delegate messages for iOS platforms

Primary LanguageObjective-COtherNOASSERTION

WZProtocolInterceptor

[![CI Status](http://img.shields.io/travis/Hai Feng Kao/WZProtocolInterceptor.svg?style=flat)](https://travis-ci.org/Hai Feng Kao/WZProtocolInterceptor) Version License Platform

I shamelessly copy the code from SO. All credits and rights belong to WeZZard.

Example

To intercept the messages between dataSource and UICollectionView

    WZProtocolInterceptor* dataSourceInterceptor = [[WZProtocolInterceptor alloc]
                                                    initWithInterceptedProtocol:@protocol(UICollectionViewDataSource)];
    dataSourceInterceptor.middleMan = self;
    dataSourceInterceptor.receiver = dataSource;
    _dataSourceInterceptor = dataSourceInterceptor;
    _collectionView.dataSource = (id<UICollectionViewDataSource>) dataSourceInterceptor;

Requirements

Installation

WZProtocolInterceptor is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "WZProtocolInterceptor"

Author

WeZZard

License

WZProtocolInterceptor is available under the CC-BY-SA 3.0 license. See the LICENSE file for more info.