Zac Zac - 2 months ago 66
Swift Question

dispatch_group_async function in swift 3.0

My question is how to correctly translate this function in Swift 3 because i noticed there is a lot of documentation about

dispatch_async
but there isn't anything about
dispatch_group_async


dispatch_group_async(group, dispatch_get_global_queue(QOS_CLASS_USER_INITIATED, 0)) { [unowned self] in

Answer

Try this:

let group = DispatchGroup()

DispatchQueue.global(qos: .userInitiated)
    .async(group:group) { [unowned self] in
        // code
    }
Comments