BTFLeakDetect helps detecting whether UIViewController instances leak after they are dismissed from a parent view controller or popped from a navigation view controller.
You can enable BTFLeakDetect by simply adding to your application:didFinishLaunchingWithOptions:
either
[BTFLeakDetect enableWithException]
which throws an exception when a leak is detected, or
[BTFLeakDetect enableWithLogging];
if you just want to get noticed in the log.
Enabling exceptions is adviced, since this helps you catch the leak as early as possible in the development fase. This way there's less code to consider, meaning less need for instrumentation.
You probably want to enable BTFLeakDetect in development only, so wrapping in #ifdef DEBUG
or similar is also a good idea.
To run the example project, clone the repo, and run pod install
from the Example directory first.
BFTLeakDetect will work with iOS 7 and up.
BTFLeakDetect is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "BTFLeakDetect"
Mikkel Gravgaard, mikkel@klokke.dk
BTFLeakDetect is available under the MIT license. See the LICENSE file for more info.