3、GCD-swift-group

来个坏习惯,先贴个代码:

open class DispatchGroup : DispatchObject {
}

extension DispatchGroup {

    public func notify(qos: DispatchQoS = default, flags: DispatchWorkItemFlags = default, queue: DispatchQueue, execute work: @escaping @convention(block) () -> ())

    public func notify(queue: DispatchQueue, work: DispatchWorkItem)

    public func wait()

    public func wait(timeout: DispatchTime) -> DispatchTimeoutResult

    public func wait(wallTimeout timeout: DispatchWallTime) -> DispatchTimeoutResult
}

extension DispatchGroup {
    // 入组
    public func enter()
    // 出组
    public func leave()
}

你可能感兴趣的:(3、GCD-swift-group)