How to use background thread in swift?

Swift 3.0+ A lot has been modernized in Swift 3.0. Running something on a background queue looks like this: DispatchQueue.global(qos: .userInitiated).async { print(“This is run on a background queue”) DispatchQueue.main.async { print(“This is run on the main queue, after the previous code in outer block”) } } Swift 1.2 through 2.3 let qualityOfServiceClass = QOS_CLASS_USER_INITIATED … Read more