LifetimeTracker reports retain cycles and memory leaks while you develop iOS apps. It tracks object lifetimes in Swift and Objective-C without relying on pure-Swift runtime tricks alone.
Overview
LifetimeTracker surfaces memory retention problems during everyday development rather than only when you later open Instruments or the Memory Graph Debugger. It focuses on counting how long key objects stay alive so excess instances show up immediately.
Unlike some detectors that lean heavily on Objective-C runtime magic, this tool tracks explicit lifetimes so it works across Objective-C and Swift types, including pure Swift classes. Developers conform types to a trackable protocol and call lifetime tracking from initializers, usually on view models and controllers.
Integration adds a dashboard at app launch via AppDelegate or SceneDelegate. The overlay can stay visible always, stay hidden, or appear only when issues are detected. Bar and circular presentation styles are supported, and tracked types can be grouped with shared limits.
Installation is available through CocoaPods, Carthage, and Swift Package Manager. Optional hooks feed leak notifications to analytics, Danger can remind teams to verify cycles on pull requests, and accessibility identifiers support UI tests that assert a clean summary.
Key features
- Live retain cycle alerts
- Swift and Objective-C support
- Bar or circular dashboard UI
- Grouped lifetime limits
- Danger workflow integration
- onLeakDetected callbacks
- CocoaPods and Carthage
- UI test accessibility hooks
Use cases
- Catching leaks during feature work
- Tracking view model lifetimes
- PR memory regression checks
- Swift UI controller debugging
- Automated leak summary tests