Latest 1.0.0
Homepage https://github.com/Polidea/PLObservers
License MIT
Platforms ios 7.0, requires ARC
Authors

Version
License
Platform

Small tool for fast implementation of multi-observer pattern in Objective-C

Usage

Given you have a observer protocole (basicly the same as a delegate protocole):

@protocol ObserverProtocol <NSObject>

- (void)somethingDidHappen:(NSString *)message more:(NSInteger)more;

@end

Create an instance of PLObservers with your delegate protocol:

PLObservers <ObserverProtocol> *observers = (PLObservers <ObserverProtocol>*)[[PLObservers alloc] initWithObserverProtocol:@protocol(ObserverProtocol)];

Add/remove as many observers (implementing your PLObservers) as you like:

[observers addObserver:myObserver1]
[observers removeObserver:myObserver2]

Calling a ObserverProtocol method on the PLObservers instance will be forwarded to the registered observers:

[observers somethingDidHappen:@"test" more:123] 

Installation

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

pod "PLObservers"

Author

Antoni Kedracki, [email protected]
Polidea

License

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

Latest podspec

{
    "name": "PLObservers",
    "version": "1.0.0",
    "summary": "Multi-observers for Objective-C",
    "description": "                       Small tool for fast implementation of multi-observer pattern in Objective-Cn",
    "homepage": "https://github.com/Polidea/PLObservers",
    "license": "MIT",
    "authors": {
        "Antoni Kedracki": "[email protected]"
    },
    "source": {
        "git": "https://github.com/Polidea/PLObservers.git",
        "tag": "1.0.0"
    },
    "social_media_url": "https://twitter.com/polidea",
    "platforms": {
        "ios": "7.0"
    },
    "requires_arc": true,
    "source_files": "Pod/Classes/**/*"
}

Pin It on Pinterest

Share This