Latest 0.0.1
License MIT
Platforms ios 6.0, requires ARC

A simple proxy that forwards optional methods to delegates – less boilerplate in your code!

When calling optional delegates, the regular pattern is to check using respondsToSelector:, then actually call the method. This is straightforward and easy to understand:

    id<PSPDFResizableViewDelegate> delegate = self.delegate;
    if ([delegate respondsToSelector:@selector(resizableViewDidBeginEditing:)]) {
        [delegate resizableViewDidBeginEditing:self];

What we really want is something like this:

    [self.delegateProxy resizableViewDidBeginEditing:self];

Read more on my blog: Smart Proxy Delegation


MIT License.

Latest podspec

    "name": "PSTDelegateProxy",
    "version": "0.0.1",
    "summary": "A simple proxy that forwards optional methods to delegates",
    "description": "                   Calling optional delegate methods usually needs lots ofn                   boilerplate code, because we need to check if the delegaten                   responds to a given selector. Using `NSProxy` we can reducen                   such boilerplate code and just call the optional method.n                   We also get compiler checks for method signatures.n",
    "homepage": "",
    "license": "MIT",
    "authors": {
        "Peter Steinberger": "[email protected]"
    "platforms": {
        "ios": "6.0"
    "source": {
        "git": "",
        "commit": "535c16db5212bf7ef7757c344ee7738e9fb95009"
    "source_files": "PSTDelegateProxy.{h,m}",
    "requires_arc": true

Pin It on Pinterest

Share This