             nc.removeObserver(observer)
         }
     }
-    
+
+    ///  Adds a completion observer to an animation.
+    ///
+    ///  The completion observer listens for the end of the animation then executes a specified block of code.
+    ///
+    ///  - parameter action: a block of code to be executed at the end of an animation.
+    ///
+    ///  - returns: the observer object.
     public func addCompletionObserver(action: () -> Void) -> AnyObject {
         let nc = NSNotificationCenter.defaultCenter()
         let observer = nc.addObserverForName(C4AnimationCompletedEvent, object: self, queue: NSOperationQueue.currentQueue(), usingBlock: { notification in

        completionObservers.append(observer)
        return observer
    }
    
    public func removeCompletionObserver(observer: AnyObject) {
        let nc = NSNotificationCenter.defaultCenter()
        nc.removeObserver(observer, name: C4AnimationCompletedEvent, object: self)
    }
    
    public func postCompletedEvent() {
        dispatch_async(dispatch_get_main_queue()) {
            NSNotificationCenter.defaultCenter().postNotificationName(C4AnimationCompletedEvent, object: self)
        }
    }

    public func addCancelObserver(action: () -> Void) -> AnyObject {
        let nc = NSNotificationCenter.defaultCenter()
        let observer = nc.addObserverForName(C4AnimationCancelledEvent, object: self, queue: NSOperationQueue.currentQueue(), usingBlock: { notification in

    private var completionObservers: [AnyObject] = []
    private var cancelObservers: [AnyObject] = []


    static var stack = [C4Animation]()
    static var currentAnimation: C4Animation? {
        return stack.last
    }

    ///Intializes an empty animation object.
    public init() {
        
    }
