     
     @IBInspectable var backViewColor: UIColor = UIColor.whiteColor()
     
+    var animationItemViews: [RotatedView]?
+    
     enum AnimationType {
         case Open
         case Close

    
    func durationSequence(type: AnimationType)-> [NSTimeInterval] {
        var durations = [NSTimeInterval]()
        for var index = 0; index < containerView.subviews.count - 1; index++ {
            let duration = animationDuration(index, type: .Open)
            durations.append(NSTimeInterval(duration / 2.0))
            durations.append(NSTimeInterval(duration / 2.0))

                let rotatedView = contener as! RotatedView
                previusView?.addBackView(rotatedView.bounds.size.height, color: backViewColor)
                previusView = rotatedView
            }
        }
    }
    
    func createAnimationItemView()->[RotatedView] {
        var items = [RotatedView]()
        items.append(foregroundView)
        var rotatedViews = [RotatedView]()
        for itemView in containerView.subviews.filter({$0 is RotatedView}).sort({ $0.tag < $1.tag }) as! [RotatedView] {
            rotatedViews.append(itemView)
            if itemView.backView != nil {
                rotatedViews.append(itemView.backView!)
            }
        }
        items.appendContentsOf(rotatedViews)
        return items
    }
    
    func configureAnimationItems(animationType: AnimationType) {
        if animationType == .Open {
            for view in containerView.subviews.filter({$0 is RotatedView}) {
                view.alpha = 0;
            }
        } else { // close
            for view: RotatedView in containerView.subviews.filter({$0 is RotatedView}) as! [RotatedView] {
                if animationType == .Open {
                    view.alpha = 0
                } else {
                    view.alpha = 1
                    view.backView?.alpha = 0
                }
            }
        }
    }
