Catch leaking view controllers without opening Instruments.
Swift Ruby
Switch branches/tags
Nothing to show
Latest commit e14481b Jul 16, 2017 @fastred Bump version to 1.0.2

README.md

DeallocationChecker

Learn about leaking view controllers without opening Instruments.

Usage

First, import the library using import DeallocationChecker. Then call dch_checkDeallocation() from viewDidDisappear(_:) in your view controllers:

    override func viewDidDisappear(_ animated: Bool) {
        super.viewDidDisappear(animated)

        dch_checkDeallocation()
    }

If a view controller isn’t deallocated after disappearing for good, an assertion inside dch_checkDeallocation(usingDelay:) will fail:

Failed assertion

At this point we can simply open the Memory Graph Debugger to investigate the reason of a cycle.

Installation

CocoaPods

Add the line pod "DeallocationChecker" to your Podfile

Carthage

Add the line github "fastred/DeallocationChecker" to your Cartfile

Author

Project created by Arek Holko (@arekholko on Twitter).