This is my code. I don't understand why deinit is not called.
class SplashVC: UIViewController {
init() {
super.init(nibName: nil, bundle: nil)
print("SplashVC created")
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
DispatchQueue.main.asyncAfter(deadline: .now() + 2) { [weak self] in
self?.navigationController?.popViewController(animated: false)
self?.navigationController?.pushViewController(SignupViewController(), animated: true)
}
}
deinit {
print("SplashVC free")
}
required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
}