尝试从其他页面执行代码。不工作

时间:2016-08-27 22:27:42

标签: ios swift xcode uiviewcontroller viewcontroller

我在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
            }

0 个答案:

没有答案
相关问题