Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/swift/19.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 在特定时间内每次更新一次_Ios_Swift - Fatal编程技术网

Ios 在特定时间内每次更新一次

Ios 在特定时间内每次更新一次,ios,swift,Ios,Swift,我如何控制更新在特定时间段内执行一次您的代码没有给您的问题增加太多内容,因此我不知道这是否是您要查找的内容,但这里有一些代码可以每X时间调用一个函数swift 3: override func update(_ currentTime: TimeInterval) { // Called before each frame is rendered parallax.update(currentTime) } 请在发布问题之前搜索->您确定所有这些标签都适用吗?不。我是这里的大三

我如何控制更新在特定时间段内执行一次

您的代码没有给您的问题增加太多内容,因此我不知道这是否是您要查找的内容,但这里有一些代码可以每X时间调用一个函数swift 3:

override func update(_ currentTime: TimeInterval) {
    // Called before each frame is rendered
    parallax.update(currentTime)
}

请在发布问题之前搜索->

您确定所有这些标签都适用吗?不。我是这里的大三学生。请原谅,如果某事是错误的,可能的重复是的,解决了问题。谢谢好的,你可以将我的答案设置为已批准,你应该修改你的问题,使其更清晰,而不是回答糟糕和重复的问题,你应该将它们标记为重复的问题。你是对的,我没有检查它是否重复
// call MyMethod every 1 second :
Timer.scheduledTimer(timeInterval: 1, target: self, selector: #selector(MyController.myMethod), userInfo: nil, repeats: true)