 import AXAnimationChainSwift
 
 public extension UIView {
+    /// Associate keys strtuct.
     private struct AssociateKeys {
         static var afterContext = "afterContext"
         static var waitContext = "waitContext"
     }
-    
+    /// Spring animation parameters.
     public typealias SpringValue = (mass: CGFloat, stiffness: CGFloat, damping: CGFloat)
-    
+    /// Animation type run as basic, spring and so on.
     public enum AnimationType {
         /*
         public enum EffectType: String {

        
        case setted, basic(CAMediaTimingFunction?), spring(SpringValue?)
    }
    
    private var afterContext: Double? {
        get { return (objc_getAssociatedObject(self, &AssociateKeys.afterContext) as? Double) }
        set { objc_setAssociatedObject(self, &AssociateKeys.afterContext, newValue, .OBJC_ASSOCIATION_RETAIN_NONATOMIC) }
    }
    
    private var waitContext: Any {
        get { return objc_getAssociatedObject(self, &AssociateKeys.waitContext) }
        set { objc_setAssociatedObject(self, &AssociateKeys.waitContext, newValue, .OBJC_ASSOCIATION_RETAIN_NONATOMIC) }
    }
    
    // MARK: - Animation type.
    public func basic(_ timingFunction: CAMediaTimingFunction = .default()) -> Self {
        let _ = chainAnimator.top.combinedAnimators?.last?.replace(with: chainAnimator.top.combinedAnimators?.last?.beginBasic().timingFunction(timingFunction))
        return self
    }
    
    public func spring(mass: CGFloat = 1, stiffness: CGFloat = 100, damping: CGFloat = 10) -> Self {
        let _ = chainAnimator.top.combinedAnimators?.last?.replace(with: chainAnimator.top.combinedAnimators?.last?.beginSpring().mass(mass).stiffness(stiffness).damping(damping))
        return self
    }
    
    // MARK: - Animate.
    public func animate(as animationType: AnimationType = .setted, completion: @escaping () -> Void = {}) {
        switch animationType {
        case .basic(let timingFunction):

    }
    
    // MARK: - Timing control.
    /// Set the duration of animation to the receiver.
    ///
    /// - Parameter duration: time duration of the animation.
    ///
    public func duration(_ duration: TimeInterval) -> Self {
        chainAnimator.top.combinedAnimators?.last?.duration(duration)
        return self
    }
    /// Set the begin time duration of the next animation.
    ///
    /// - Parameter duration: Time duration of the next animation begin time.
    ///
    public func after(_ duration: TimeInterval) -> Self {
        if let after = afterContext {
            afterContext = after + duration
