I was wondering, is there any tool, which can help to detect memory leak caused by missing [weak self].
For instance, the following code contains memory leak issue caused by lack of [weak self]
class ImagePageViewController: UIPageViewController {
lazy var memoryLeak = UIAction(
title: "memory_leak",
image: nil
) { _ in
print(">>>> \(self)")
}
}
Is there any tool which can help us to prevent such issue? I have tried https://github.com/realm/SwiftLint
but it is not able to detect such.