TestsTested | ✓ |
LangLanguage | SwiftSwift |
License | MIT |
ReleasedLast Release | Sep 2015 |
SPMSupports SPM | ✗ |
Maintained by Mark Smith.
GCDSwift is a Swift wrapper for the most commonly used features of Grand Central Dispatch. It has four main aims:
GCDSwift defines the same API as GCDObjC.
GCDSwift requires Swift 2.0.
For usage examples, see GCDSwiftTests.m.
Queues are implemented in the GCDQueue class.
class var mainQueue: GCDQueue { get }
class var globalQueue: GCDQueue { get }
class var highPriorityGlobalQueue: GCDQueue { get }
class var lowPriorityGlobalQueue: GCDQueue { get }
class var backgroundPriorityGlobalQueue: GCDQueue { get }
class func serialQueue() -> GCDQueue
class func concurrentQueue() -> GCDQueue
func queueBlock(block: dispatch_block_t)
func queueBlock(block: dispatch_block_t, afterDelay seconds: Double)
func queueBlock(block: dispatch_block_t, inGroup group: GCDGroup)
func queueAndAwaitBlock(block: dispatch_block_t)
func queueAndAwaitBlock(block: ((Int) -> Void), iterationCount count: Int)
func queueBarrierBlock(block: dispatch_block_t)
func queueAndAwaitBarrierBlock(block: dispatch_block_t)
func queueNotifyBlock(block: dispatch_block_t, inGroup group: GCDGroup)
func suspend()
func resume()
Semaphores are implemented in the GCDSemaphore class.
GCDSemaphore()
GCDSemaphore(value: CLong)
func signal() -> Bool
func wait()
func wait(seconds: Double) -> Bool
Groups are implemented in the GCDGroup class.
GCDGroup()
func enter()
func leave()
func wait()
func wait(seconds: Double) -> Bool