Latest 0.1.3
Homepage https://github.com/ML-Works/orNil
License MIT
Platforms ios 7.0, requires ARC
Authors

CI Status
Version
Carthage compatible
License
Platform

Usage

Just replace all this boilerplace:

if ([self.delegate respondToSelector:@selector(photoController:didPhoto:)]) {
    [self.delegate photoController:self didPhoto:photo];
}

with tiny property orNil, working on all NSObject subclasses:

[self.delegate.orNil photoController:self didPhoto:photo];

If object not responds to selector, nil will be used as target for this selector :)

Installation

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

pod 'orNil'

Or, if you’re using Carthage, simply add orNil to your Cartfile:

github "ML-Works/orNil"

Author

Anton Bukov, k06a@mlworks.com

License

orNil is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "orNil",
    "version": "0.1.3",
    "summary": "Simple way to avoid respondsToSelector: boilerplate",
    "description": "Allows Objective-C developers remove a lot of boilerplate codenfor checking if target responds to selector with tiny property `orNil`.nIf target do not responds to selector, `nil` will be used as selector target :)",
    "homepage": "https://github.com/ML-Works/orNil",
    "license": "MIT",
    "authors": {
        "Anton Bukov": "k06a@mlworks.com"
    },
    "source": {
        "git": "https://github.com/Ml-Works/orNil.git",
        "tag": "0.1.3"
    },
    "social_media_url": "https://twitter.com/k06a",
    "platforms": {
        "ios": "7.0"
    },
    "requires_arc": true,
    "source_files": "Pod/Classes/**/*"
}

Pin It on Pinterest

Share This