我在swift文件中调用此函数但它似乎不起作用。例如,计时器没有停止。有关如何从下面显示的代码修复它的任何想法?感谢。
var vc = ViewController()
func application(application: UIApplication, didFinishLaunchingWithOptions: [NSObject: AnyObject]?) -> Bool
{
vc.endGame()
vc.startButton!.hidden = false
vc.timer!.invalidate()
vc.timer = nil
// This is calling the function from the view controller
return true
}