Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

DISPATCH_QUEUE_T in Swift 3 [duplicate]

Tags:

ios

swift

swift3

I'm programming my first Swift 3 but I came across the following error

dispatch_queue_t is unavailable in swift.

var queue: dispatch_queue_t?

var debugPrint = false

public init() {
    let uuid = NSUUID().uuidString
    let queueLabel = "tomlogger-queue-" + uuid
    queue = dispatch_queue_create(queueLabel, DISPATCH_QUEUE_SERIAL)

}

Does anyone know how I solve this error,

Thomas

like image 657
Thomas Delputte Avatar asked Dec 10 '22 15:12

Thomas Delputte


1 Answers

You need to use DispatchQueue instead, libdispatch was modernised to match the swift 3 syntax, see the proposal SE-0088

like image 58
rhyshort Avatar answered Jan 03 '23 22:01

rhyshort