5

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

Thomas Delputte
  • 141
  • 1
  • 2
  • 6

1 Answers1

15

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

rhyshort
  • 1,453
  • 11
  • 17