I am running the following in Playground, but nothing is getting printed :
DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + DispatchTimeInterval.seconds(1)) {
print("hiii")
}
I am running the following in Playground, but nothing is getting printed :
DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + DispatchTimeInterval.seconds(1)) {
print("hiii")
}
You can do this, to make it wait for your async thread:
PlaygroundPage.current.needsIndefiniteExecution = true