I have timer = NSTimer.scheduledTimerWithTimeInterval(3.0, target: self, selector: "get", userInfo: nil, repeats: true)
in FirstVC
and var timer: NSTimer?
out of class(I mean declared globally).
Then I want call timer?.invalidate()
in applicationDidEnterBackground
or applicationWillResignActive
in AppDelegate
, but it doesn't work.
What do I do wrong?