Latest1.0.0
Homepagehttps://github.com/ladeiko/OnDeallocateX
LicenseCUSTOM
Platformsios 9.0, requires ARC
Authors

Helper code to track iOS objects deallocation

Installation

Cocoapods

Add to your Podfile:

pod 'OnDeallocateX'

Manually

Clone repository, then include "Sources" folder to your project.

Usage

Class of object to be tracked should be inherited from NSObject.

class TestObject: NSObject {
    deinit {
        print("deinit")
    }
}

let t = TestObject()
t.onWillDeallocate {
    // NOTE: Please do not keep strong references to object inside this callback!!!
    print("will deallocate")
}

// Here object is deallocated, because no more references to it and you will see in console:
// ...
// will deallocate
// deinit
// ...

NOTE: onWillDeallocate will be called before deallocation, but real deallocation can be performed later (in case of additional strong references to object).

License

MIT. See LICENSE

Authors

Latest podspec

{
    "name": "OnDeallocateX",
    "version": "1.0.0",
    "summary": "Code to track iOS objects deallocation",
    "homepage": "https://github.com/ladeiko/OnDeallocateX",
    "license": {
        "type": "CUSTOM",
        "file": "LICENSE"
    },
    "authors": {
        "Siarhei Ladzeika": "[email protected]"
    },
    "platforms": {
        "ios": "9.0"
    },
    "source": {
        "git": "https://github.com/ladeiko/OnDeallocateX.git",
        "tag": "1.0.0"
    },
    "source_files": "Classes/**/*.{h,m}",
    "requires_arc": true
}

Pin It on Pinterest

Share This