Create a GCD queue in Swift?

I am getting a failure while creating a GCD queue in Swift, any idea?

var q: dispatch_queue_t?
q = dispatch_queue_create("com.kukodajanos.queryPlaces", 0)

enter image description here

+4
source share
4 answers

By looking at the documentary comments for it using alt + click, you can see:

Image

In attr you can pass 3 things: nil, DISPATCH_QUEUE_SERIAL and DISPATCH_QUEUE_CONCURRENTnot Int.

+6
source

Passing nil instead of 0:

    var q: dispatch_queue_t?
    q = dispatch_queue_create("com.kukodajanos.queryPlaces", nil)
+5
source

, , , nil, 0.

, ? , . , , , , , :

let q = dispatch_queue_create("com.kukodajanos.queryPlaces", nil)
+1

Passing zero instead of 0, since dispatch_queue_attr_t shoild does the trick. In addition, the function returns an implicitly expanded optional, rather than optional, what specifically?

0
source

All Articles