Playground 延时运行

2017-02-05  本文已影响16人  fordring2008

// 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)

上一篇 下一篇

猜你喜欢

热点阅读