unlockagency/dysprosium
Dysprosium is part of the **[E-sites iOS Suite](https://github.com/e-sites/iOS-Suite)**.
Log deallocations
This way you can easily see what objects have been deallocated.
import Dysprosium
class SomeObject: DysprosiumCompatible {
// ...
deinit {
deallocated()
}
}Expect deallocations
UIViewController
Most of the time when a UIViewController disappears it should be deallocated. With expectDeallocation() you can monitor if it actually is deallocated.
import Dysprosium
class SomeViewController: UIViewController, DysprosiumCompatible {
// ...
override func viewDidDisappear(_ animated: Bool) {
super.viewDidDisappear(animated)
expectDeallocation()
}
deinit {
deallocated()
}
}Related objects
If an object gets deallocated, but you need to check that an underlying object is deallocated as well:
import Dysprosium
class SomeObject: DysprosiumCompatible {
// ...
let relatedObject: SomeObject
deinit {
relatedObject.expectDeallocation()
deallocated()
}
}Release builds
Disable Dysprosium like this:
Dysprosium.shared.isEnabled = falsePackage Metadata
Repository: unlockagency/dysprosium
Default branch: master
README: README.md