Stop NSTimer and dismiss view controller (swift)
问题 I am using NSTimer to look for updates in my firebase database. I have put the code inside my viewDidLoad() . NSTimer.scheduledTimerWithTimeInterval(5.0, target: self, selector: #selector(DriversInterfaceViewController.CheckFormularChild), userInfo: nil, repeats: true) When the user has received a file in the database I want the user to goto another ViewController . The problem is that either the old ViewController is running in the background or the timer does not stop when changing View