Creating a concurrent queue

let concurrentQueue = DispatchQueue(label: "queuename", attributes: .concurrent)
concurrentQueue.sync {

}  

Create a serial queue

let serialQueue = DispatchQueue(label: "queuename")
serialQueue.sync { 

}

Get main queue asynchronously

DispatchQueue.main.async {

}

Get main queue synchronously

DispatchQueue.main.sync {

}

To get one of the background thread

DispatchQueue.global(attributes: .qosDefault).async {

}

Xcode 8.2 beta 2:

To get one of the background thread

DispatchQueue.global(qos: .default).async {

}

DispatchQueue.global().async {
    // qos' default value is ´DispatchQoS.QoSClass.default`
}

If you want to learn about using these queues .See this answer

'IOS' 카테고리의 다른 글

xcode 인덱싱 비활성화..  (0) 2017.08.04
array union, intersection 관련내용  (0) 2017.06.30
xcode pod 파일들이 엉켰을때..  (0) 2017.06.29
스위프트 공부 참고 사이트  (0) 2017.04.10
스위프트 추천 기술들  (0) 2017.04.10

+ Recent posts