I'd like to add a countdown to my app that reboots the app in two minutes. I dont want to restart the app physically. I only want to open the ViewController. The problem is that this function should be called from every page/ViewController.
So I created a Util/Helper class/Singleton which should handle this. But I cannot call the pushViewController method because it is no ViewController class. So I have no navigationController and I think it is not possible to pass this navigationController. How could I handle it?
Passing the navigationController to the Manager called an "unrecognized selector sent to instance" error.
@objc func decrementCounter(vc: UINavigationController) {
if(counter == 0) {
let viewController = ViewController()
vc.pushViewController(viewController, animated: true)
} else {
counter -= 1
}
print("Counter: \(counter)")
}