CocoaPods trunk is moving to be read-only. Read more on the blog, there are 18 months to go.

Stalker 1.2.0

Stalker 1.2.0

TestsTested
LangLanguage Obj-CObjective C
License MIT
ReleasedLast Release Jul 2015

Maintained by Luca Querella.



Stalker 1.2.0

  • By
  • Luca Querella

Heavily inspired by KVOController, Stalker offers a developer-friendly, block-based interface to KVO and NSNotification.

How to use it

//import the header
#import "NSObject+Stalker.h"

// observe the property 'count' for the object spoons
[self.stalker whenPath:@"count"
       changeForObject:spoons
               options:NSKeyValueObservingOptionNew 
                  then:^(id object, NSDictionary *change) {

               }];

// listen to the notification UIApplicationDidBecomeActiveNotification
[self.stalker when:UIApplicationDidBecomeActiveNotification 
              then:^(NSNotification *notification) {

}];

note that:

  • You don't need to unobserve. it's automagically done when the object is deallocated
  • You don't need to create an instance of STStalker, it's already available through the category NSObject+Stalker

Contact

Luca Querella [email protected]