GCDKit中央调度简化
GCDKit 是使用 Swift 编写的 Grand Central Dispatch 简化版本。
iOS SDK:
let mainQueue = dispatch_get_main_queue() let defaultQueue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0) let customSerialQueue = dispatch_queue_create("mySerialQueue", DISPATCH_QUEUE_SERIAL) let customConcurrentQueue = dispatch_queue_create("myConcurrentQueue", DISPATCH_QUEUE_CONCURRENT)
GCDKit:
let mainQueue: GCDQueue = .Mainlet defaultQueue: GCDQueue = .Default let customSerialQueue: GCDQueue = .createSerial("mySerialQueue") let customConcurrentQueue: GCDQueue = .createConcurrent("myConcurrentQueue")
评论