 private let C4AnimationCompletedEvent = "C4AnimationCompleted"
 private let C4AnimationCancelledEvent = "C4AnimationCancelled"
 
+/// Defines an object that handles the creation of animations for specific actions and keys.
 public class C4Animation {
+    ///  Specifies the supported animation curves.
+    ///
+    ///  ````
+    ///  animation.curve = .EaseIn
+    ///  ````
     public enum Curve {
+        /// A linear animation curve causes an animation to occur evenly over its duration.
         case Linear
+        /// An ease-out curve causes the animation to begin quickly, and then slow down as it completes.
         case EaseOut
+        /// An ease-in curve causes the animation to begin slowly, and then speed up as it progresses.
         case EaseIn
+        /// An ease-in ease-out curve causes the animation to begin slowly, accelerate through the middle of its duration, and then slow again before completing. This is the default curve for most animations.
         case EaseInOut
     }
-    
+
+    /// Determines if the animation plays in the reverse upon completion.
     public var autoreverses = false
+
+    /// Specifies the number of times the animation should repeat.
     public var repeatCount = 0.0
+
+    /// If `true` the animation will repeat indefinitely.
     public var repeats: Bool {
         get {
             return repeatCount > 0

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

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

    public init() {
        
    }

        completionObservers.append(observer)
        return observer
    }

    ///  Removes a specified observer from an animation.
    ///
    ///  - parameter observer: the observer object to remove.
    public func removeCompletionObserver(observer: AnyObject) {
        let nc = NSNotificationCenter.defaultCenter()
        nc.removeObserver(observer, name: C4AnimationCompletedEvent, object: self)
    }

    ///  Posts a completion event.
    ///
    ///  This method is triggered when an animation completes. This can be used in place of `addCompletionObserver` for objects outside the scope of the context in which the animation is created.
    public func postCompletedEvent() {
        dispatch_async(dispatch_get_main_queue()) {
            NSNotificationCenter.defaultCenter().postNotificationName(C4AnimationCompletedEvent, object: self)
        }
    }

    ///  Adds a cancel observer to an animation.
    ///
    ///  The cancel observer listens for when an animation is canceled then executes a specified block of code.
    ///
    ///  - parameter action: a block of code to be executed when an animation is canceled.
    ///
    ///  - returns: the observer object.
    public func addCancelObserver(action: () -> Void) -> AnyObject {
        let nc = NSNotificationCenter.defaultCenter()
        let observer = nc.addObserverForName(C4AnimationCancelledEvent, object: self, queue: NSOperationQueue.currentQueue(), usingBlock: { notification in
