Nothing prints out in the console in command line tool Xcode when I run the following code:
import Foundation
class A {
var someValue = 0
let concurren
Applications – such has command-line programs – which do not already have a "run loop" have to call
dispatch_main() // Swift 2
dispatchMain() // Swift 3
in order to use GCD. From the documentation:
This function "parks" the main thread and waits for blocks to be submitted to the main queue. Applications that call
UIApplicationMain(iOS),NSApplicationMain(Mac OS X), orCFRunLoopRunon the main thread must not calldispatch_main.