Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

dispatch_group_async function in swift 3.0

Tags:

swift

swift3

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
like image 936
Zac Avatar asked Sep 18 '16 19:09

Zac


1 Answers

Try this:

let group = DispatchGroup()

DispatchQueue.global(qos: .userInitiated)
    .async(group:group) { [unowned self] in
        // code
    }
like image 83
Code Different Avatar answered Oct 16 '22 17:10

Code Different