   /// finish. Finishing includes cancelling. Hence when this operation finishes,
   /// all its component operations have also finished.
   public override func execute() {
-    q.suspended = false
-    q.waitUntilAllOperationsAreFinished()
+    suspended = false
+    waitUntilAllOperationsAreFinished()
   }
 
 }


import Foundation

public class GroupOperation: Operation {

  let q = OperationQueue()

  public override init() {
    super.init()
    q.suspended = true
    q.delegate = self
  }


    q.addOperation(op)
  }

  /// Accesses the group's suspend status.
  public var suspended: Bool {
    get {
      return q.suspended
    }
    set(newSuspended) {
      q.suspended = newSuspended
    }
  }

  /// Waits until all the group's operations are finished.
  public func waitUntilAllOperationsAreFinished() {
    q.waitUntilAllOperationsAreFinished()
  }

  /// Waits for all group sub-operations to finish, then checks if the operation
  /// itself has been cancelled. That does not mean that the finished
  /// sub-operations themselves were cancelled.
  /// - returns: True if this operation has been cancelled and should terminate
  ///   at the earliest opportunity, false if the operation should continue.
  public func waitUntilNotCancelled() -> Bool {
    waitUntilAllOperationsAreFinished()
    return !cancelled
  }

  //----------------------------------------------------------------------------
  // MARK: - Operation Overrides

