0

我在Playground中运行以下命令,但没有打印任何内容:

DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + DispatchTimeInterval.seconds(1)) {
    print("hiii")
}
4

1 回答 1

3

你可以这样做,让它等待你的异步线程:

PlaygroundPage.current.needsIndefiniteExecution = true
于 2019-01-09T12:01:27.640 回答