Latest 1.0.1
Homepage https://github.com/Jerry0523/JWObserver
License MIT
Platforms ios 7.0, requires ARC
Authors

An observer for iOS developers.

Features

You can observe objects dealloc by block.

[JWObserver observeDealloc:yourObj
                     owner:yourOwner
           completionBlock:^(__kindof NSObject *target) {
    NSLog(@"%@ dealloc", target);
    ...
}];

You can easily remove the dealloc observer.

[JWObserver unObserveDealloc:yourObj
                       owner:yourOwner];

You can reach KVO by block and don’t need to concern removing issues.

[JWObserver observeTarget:yourTarget
             propertyName:@"yourPropertyName"
                    owner:yourOwner
          completionBlock:^(__kindof NSObject *target, id oldValue, id newValue) {
    ...
}];

You can simply remove KVO by a class function,no concern for crashing issues. And if you donnot call the unobserve function, it will auto remove KVO when your owner or your target dealloc.

[JWObserver unObserveTarget:yourTarget
               propertyName:@"yourPropertyName"
                      owner:yourOwner];

Installation with CocoaPods

CocoaPods is a dependency manager for Objective-C, which automates and simplifies the process of using 3rd-party libraries. You can install it with the following command:

$ gem install cocoapods

Podfile

To integrate JWObserver into your Xcode project using CocoaPods, specify it in your Podfile:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'

pod 'JWObserver'

Then, run the following command:

$ pod install

License

(MIT license)

Latest podspec

{
    "name": "JWObserver",
    "version": "1.0.1",
    "summary": "An observer for iOS developers. You can observe object dealloc and KVO by block.",
    "homepage": "https://github.com/Jerry0523/JWObserver",
    "license": "MIT",
    "authors": {
        "Jerry Wong": "[email protected]"
    },
    "platforms": {
        "ios": "7.0"
    },
    "source": {
        "git": "https://github.com/Jerry0523/JWObserver.git",
        "tag": "1.0.1"
    },
    "source_files": "JWObserver/*.{h,m}",
    "requires_arc": true
}

Pin It on Pinterest

Share This