美文网首页
Playground 延时运行

Playground 延时运行

作者: fordring2008 | 来源:发表于2017-02-05 12:32 被阅读16次

// Playground 延时运行

// 及时编辑的 REPL 环境

// cmd + option + 回车, 打开辅助编辑器,可以看到时间轴

import PlaygroundSupport

PlaygroundPage.current.needsIndefiniteExecution = true

class Foo{

@objc func show(){

print("Hi")

}

}

let obj = Foo()

Timer.scheduledTimer(timeInterval: 1, target: obj, selector: #selector(Foo.show), userInfo: nil, repeats: true)

相关文章

网友评论

      本文标题:Playground 延时运行

      本文链接:https://www.haomeiwen.com/subject/bmfeittx.html