         }
     }
     
+    /**
+        Dispatches the block asynchronously on specified queue.
+    
+        :param: block   Block to be executed.
+    */
     public func dispatchAsyncOnQueue(queue: DispatchQueue, block: dispatch_block_t) {
         dispatch_group_async(group, queue.queue, block)
     }
     
+    /**
+        Waits for number of seconds for the group to finish. 
+    
+        :param: seconds Nubmer of seconds to wait for the group to finish.
+    
+        :returns:       True if group returns before specified seconds, false otherwise.
+    */
     public func waitForSeconds(seconds: UInt) -> Bool {
         return dispatch_group_wait(group, SecondsFromNow(seconds)) == 0
     }
     
+    /**
+        Waits forever for the group to finish.
+    */
     public func waitForever() -> Bool {
         return dispatch_group_wait(group, DISPATCH_TIME_FOREVER) == 0
     }
     
+    /**
+        Schedules a block to be submitted to specified queue when the group finishes.
+    
+        :param: queue   Queue on wich the block is to be submitted.
+    
+        :param: block   Completion block that is to be called.
+    */
     public func notifyOnQueue(queue: DispatchQueue, block: dispatch_block_t) {
         dispatch_group_notify(group, queue.queue, block)
     }
     
-    public func notify(queue: DispatchQueue, block: dispatch_block_t) {
+    
+    /**
+        Schedules a block to be submitted to designated async queue when the group finishes.
+    
+        :param: block   Completion block that is to be called.
+    */
+    public func notify(block: dispatch_block_t) {
         if let queue = asyncQueue {
             dispatch_group_notify(group, queue.queue, block)
         } else {

        dispatch_group_leave(group)
    }

    public func dispatchSync(block: dispatch_block_t) {
        enter()
        block()
        leave()
    }
    
    public func dispatchAsync(block: dispatch_block_t) {
        if let queue = asyncQueue {
            dispatch_group_async(group, queue.queue, block)


import Foundation

/**
    Represents a dispatch group.
*/
public class DispatchGroup {
    
    let group: dispatch_group_t
    
    let asyncQueue: DispatchQueue?
  
    /**
        Designated initializer that creates a new GCD dispatch group.
    */
    public init() {
        group = dispatch_group_create()
    }
    
    /**
        Designated initializer that creates a new GCD dispatch group. The queue passed to it
        will be used to executes async block for this group.
    
        :param: asyncQueue  This queue will be used to execute async blocks for this group.
    */
    public init(asyncQueue: DispatchQueue) {
        group = dispatch_group_create()
        self.asyncQueue = asyncQueue
