I manually created a memory leak, but the Debug Memory Graph cannot detect it.
This only happens on the controller, not on the general object type.
Any one konw why?
This is the code I used
import UIKit
class ViewController: UIViewController {
override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
present(Demo(), animated: true, completion: nil)
}
}
class Demo : UIViewController {
var obj:Demo?
override func viewDidLoad() {
super.viewDidLoad()
view.backgroundColor = .systemTeal
obj = self
}
override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
dismiss(animated: true, completion: nil)
}
}