GroupOperation

open class GroupOperation : AsynchronousOperation

An AsynchronousOperation subclass which enables a finite grouping of other operations. Use a GroupOperation to associate related operations together, thereby creating higher levels of abstractions.

Public Properties

  • The maximum number of queued operations that can execute at the same time inside the GroupOperation.

    The value in this property affects only the operations that the current GroupOperation has executing at the same time. Reducing the number of concurrent operations does not affect any operations that are currently executing.

    Declaration

    Swift

    public var maxConcurrentOperationCount: Int { get set }
  • The relative amount of importance for granting system resources to the operation.

    Declaration

    Swift

    public override var qualityOfService: QualityOfService { get set }

Initializers

  • Creates a new GroupOperation.

    Declaration

    Swift

    public init(underlyingQueue: DispatchQueue? = nil, operations: [Operation])

    Parameters

    underlyingQueue

    The dispatch queue used to execute operations (the default value is nil).

    operations

    Operations to be executed by the GroupOperation

  • Creates a new GroupOperation.

    Declaration

    Swift

    public convenience init(underlyingQueue: DispatchQueue? = nil, operations: Operation...)

    Parameters

    underlyingQueue

    The dispatch queue used to execute operations (the default value is nil).

    operations

    Operations to be executed by the GroupOperation

Public Methods

  • The default implementation of this method executes the scheduled operations. If you override this method to perform the desired task, invoke super in your implementation as last statement. This method will automatically execute within an autorelease pool provided by Operation, so you do not need to create your own autorelease pool block in your implementation.

    Declaration

    Swift

    public final override func main()
  • Undocumented

    Declaration

    Swift

    public final override func cancel()
  • Adds new operations to the GroupOperation.

    If the GroupOperation is already cancelled, the new operations will be cancelled before being added. If the GroupOperation is finished, new operations will be ignored.

    Declaration

    Swift

    public func addOperations(_ operations: Operation...)
  • Adds a new operation to the GroupOperation.

    If the GroupOperation is already cancelled, the new operation will be cancelled before being added. If the GroupOperation is finished, the new operation will be ignored.

    Declaration

    Swift

    public final func addOperation(_ operation: Operation)